Openai Agents Evaluator Optimizer
agentsllmsLlamaIndexarize-phoenixopenaitutorialsevalsllmopsai-monitoringaiengineeringprompt-engineeringdatasetsllm-evalai-observabilityllm-evaluationsmolagentsanthropiclangchain
Export
OpenAI agent pattern: evaluator optimizer agent
A starter guide for building an agent which iteratively generates an output based on LLM feedback using the openai-agents library.
When creating LLM outputs, often times the first generation is unsatisfactory. You can use an agentic loop to iteratively improve the output by asking an LLM to give feedback, and then use the feedback to improve the output.
In the following example, we'll build a financial report system using this pattern:
- Report Agent (Generation): Creates a report on a particular stock ticker.
- Evaluator Agent (Feedback): Evaluates the report and provides feedback on what to improve.
Install Libraries
[ ]
Setup Keys
Add your OpenAI API key to the environment variable OPENAI_API_KEY.
Copy your Phoenix API_KEY from your settings page at app.phoenix.arize.com.
[ ]
Setup Tracing
[ ]
Creating the agent
[ ]