Public
Like
1
openai-agents
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of sentiment-analysis branch: v9View latest version
A Val Town template for analyzing sentiment around topics or names using the OpenAI Agents SDK. This agent searches news articles, social media, and web content from the last week to provide structured sentiment analysis.
-
Remix this val
-
Set the
OPENAI_API_KEYenvironment variable. Get your OpenAI API key here: https://platform.openai.com/api-keys -
Use your agent:
Send POST requests to your val endpoint:
curl -X POST https://openai-agents.val.run \ -H "Content-Type: application/json" \ -d '{"message": "Analyze the sentiment around OpenAI in the last week"}'
The agent returns a plain text summary that includes:
- Overall sentiment (positive, negative, neutral, or mixed)
- Brief summary of sentiment findings
- Key themes and topics discovered
- Specific examples with sources and citations
- Approximate number of sources analyzed
Edit the agent configuration in main.ts to:
- Adjust the time range for analysis
- Modify the output format
- Change the model or add custom tools