> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Evals

> The reliability case verifies the assistant calls the calculator's ``multiply`` tool with the expected arguments.

```python evals.py theme={null}
"""Run accuracy and reliability evaluations through AgentOS.

The reliability case verifies the assistant calls the calculator's
``multiply`` tool with the expected arguments.

Prerequisites: start ``_server.py`` and set OPENAI_API_KEY.
Run: .venvs/demo/bin/python cookbook/05_agent_os/03_python_client/05_evals.py
Try: compare the stored accuracy and reliability result payloads.
"""

import asyncio

from agno.client import AgentOSClient
from agno.db.schemas.evals import EvalType

BASE_URL = "http://localhost:7778"
AGENT_ID = "assistant"


# ---------------------------------------------------------------------------
# Create the Client
# ---------------------------------------------------------------------------


async def run_evaluations() -> None:
    """Run two evaluations, then list and fetch their stored results."""
    client = AgentOSClient(base_url=BASE_URL)

    accuracy = await client.run_eval(
        eval_type=EvalType.ACCURACY,
        input_text="What is 2 + 2?",
        agent_id=AGENT_ID,
        expected_output="4",
    )
    if accuracy is None:
        raise RuntimeError("Accuracy evaluation returned no result")
    print(f"Accuracy evaluation: {accuracy.id}")
    print(accuracy.eval_data)

    reliability = await client.run_eval(
        eval_type=EvalType.RELIABILITY,
        input_text="Use the calculator to multiply 10 by 5.",
        agent_id=AGENT_ID,
        expected_tool_calls=["multiply"],
        expected_tool_call_arguments={"multiply": {"a": 10, "b": 5}},
    )
    if reliability is None:
        raise RuntimeError("Reliability evaluation returned no result")
    print(f"Reliability evaluation: {reliability.id}")
    print(reliability.eval_data)

    eval_runs = await client.list_eval_runs(
        agent_id=AGENT_ID,
        eval_types=[EvalType.ACCURACY, EvalType.RELIABILITY],
    )
    print(f"Stored evaluations: {len(eval_runs.data)}")

    for run_id in (accuracy.id, reliability.id):
        detail = await client.get_eval_run(run_id)
        print(f"Fetched {detail.id}: {detail.eval_type.value}")


# ---------------------------------------------------------------------------
# Run the Example
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    asyncio.run(run_evaluations())
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[os]" chromadb openai
    ```
  </Step>

  <Step title="Export your API keys">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Clone Agno">
    Clone the pinned Agno source and run the remaining commands from its root:

    ```bash theme={null}
    git clone https://github.com/agno-agi/agno.git
    cd agno
    git checkout v3.0.4
    ```
  </Step>

  <Step title="Start the AgentOS server">
    Open another terminal in the parent directory where `.venv` and the cloned `agno` directory are siblings, then start the shared server on port 7778:

    <CodeGroup>
      ```bash Mac/Linux theme={null}
      source .venv/bin/activate
      export OPENAI_API_KEY="your_openai_api_key_here"
      cd agno
      python cookbook/05_agent_os/03_python_client/_server.py
      ```

      ```powershell Windows theme={null}
      .venv\Scripts\activate
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      Set-Location agno
      python cookbook/05_agent_os/03_python_client/_server.py
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Run the example from the repository root:

    ```bash theme={null}
    python cookbook/05_agent_os/03_python_client/05_evals.py
    ```
  </Step>
</Steps>

Full source: [cookbook/05\_agent\_os/03\_python\_client/05\_evals.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/05_agent_os/03_python_client/05_evals.py)
