Skip to main content
This project shows how to use 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.
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:
In a second terminal, run:

Next steps