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

# Comparison Accuracy Evaluation

> Score an agent that must use CalculatorTools to answer whether 9.11 or 9.9 is bigger, with an o4-mini judge.

Demonstrates accuracy evaluation for numeric comparison tasks.

```python accuracy_9_11_bigger_or_9_99.py theme={null}
"""
Comparison Accuracy Evaluation
==============================

Demonstrates accuracy evaluation for numeric comparison tasks.
"""

from typing import Optional

from agno.agent import Agent
from agno.eval.accuracy import AccuracyEval, AccuracyResult
from agno.models.openai import OpenAIChat
from agno.tools.calculator import CalculatorTools

# ---------------------------------------------------------------------------
# Create Evaluation
# ---------------------------------------------------------------------------
evaluation = AccuracyEval(
    name="Comparison Evaluation",
    model=OpenAIChat(id="o4-mini"),
    agent=Agent(
        model=OpenAIChat(id="gpt-5.6-luna"),
        tools=[CalculatorTools()],
        instructions="You must use the calculator tools for comparisons.",
    ),
    input="9.11 and 9.9 -- which is bigger?",
    expected_output="9.9",
    additional_guidelines="Its ok for the output to include additional text or information relevant to the comparison.",
)

# ---------------------------------------------------------------------------
# Run Evaluation
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    result: Optional[AccuracyResult] = evaluation.run(print_results=True)
    assert result is not None and result.avg_score >= 8
```

## Run the Example

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

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno openai
```

**2. Export your OpenAI API key**

```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"
```

**3. Run the example**

Save the code above as `accuracy_9_11_bigger_or_9_99.py`, then run:

```bash theme={null}
python accuracy_9_11_bigger_or_9_99.py
```

Full source: [cookbook/09\_evals/accuracy/accuracy\_9\_11\_bigger\_or\_9\_99.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/09_evals/accuracy/accuracy_9_11_bigger_or_9_99.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.