AI agents can help simplify and automate tedious workflows. By going through this fitness trainer agent example, we'll introduce how you can reduce hallucinations from AI agents by using critique-based contexting.
Set environment variables for SerpApi and OpenAI API
export OPENAI_API_KEY=...
export SERPAPI_API_KEY=...Run the script
python main.py --query "university student, loves running"default query = university student, loves running
| Argument | Default Value | Description |
|---|---|---|
| query | "university student ..." | query to search |
| llm | gpt-3.5-turbo-0613 |
OpenAI LLM to use |
| embeddings | text-embedding-ada-002 |
OpenAI embeddings model to use |
Run the script
node index.js