// Sesi Demo Script
let userName = "Tony"

/* Define a prompt for generating a quote
NOTE: No '+' operator inside prompt block body*/
prompt quotePrompt {"Generate a short, motivational quote for " userName ". Only return the quote text."}

// Function to analyze sentiment using structured output
fn analyzeSentiment(text: string) {return structured_output({sentiment: string, score: number, explanation: string})(model("gemini-3.1-flash-lite") {"Analyze the sentiment of the following quote, score it, and give an explanation. Return the result as JSON:" text})}
show "--- Sesi Demo ---"
show "Hello," userName

// Call the model to get a quote
let quote = model("gemini-3.1-flash-lite") {quotePrompt}
show "Your quote for today:" quote

// Analyze the quote's sentiment
show "Analyzing sentiment..."
let analysis = analyzeSentiment(quote)
show "Sentiment:" analysis.sentiment
show "Score:" str(analysis.score)
show "Explanation:" analysis.explanation
show "Done."