defineAgent to connect an existing HTTP agent to NiceEval. It’s a good fit for applications that need control over their own protocol and event mapping.
- View the full source
- Local directory:
examples/zh/ai-sdk/
If your application uses AI SDK v7’s UI Message Stream, prefer the built-in
uiMessageStreamAgent instead. See the corresponding non-intrusive example: AI SDK v7.What this project demonstrates
The adapter is only responsible for connecting and translating. The URL and model belong to the experiment; evals only describe the interaction and what a good result looks like. This separation lets the same evals be reused across different models and deployment instances.
Directory structure
Run it
This example calls real models — there’s no mock mode. Copy the environment variables first and fill in credentials for an OpenAI-compatible service:Next steps
- Connect Your Agent: Start from a minimal adapter and connect your own protocol.
- Write Send: Gradually fill in sessions, tools, HITL, and OTel.
- Experiment Matrix: Organize model and configuration comparisons.