Metadata-Version: 2.5
Name: agentdog
Version: 0.1.1
Summary: Lightweight evaluation toolkit for AI agents — test tool use, grounding, safety, and efficiency before production
Project-URL: Homepage, https://github.com/SaiTeja-Erukude/agentdog
Project-URL: Repository, https://github.com/SaiTeja-Erukude/agentdog
Project-URL: Bug Tracker, https://github.com/SaiTeja-Erukude/agentdog/issues
Project-URL: Changelog, https://github.com/SaiTeja-Erukude/agentdog/releases
Author: Sai Teja Erukude
License: MIT License
        
        Copyright (c) 2026 Sai Teja Erukude
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: agent,ai,evals,evaluation,llm,prompt-injection,rag,safety,testing,tool-use
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.10
Requires-Dist: click>=8.0
Provides-Extra: dev
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Provides-Extra: llm-judge
Requires-Dist: openai>=1.0; extra == 'llm-judge'
Description-Content-Type: text/markdown

# agentdog

Lightweight evaluation toolkit for AI agents. Test answers, tool use, grounding,
safety, and efficiency with captured traces or pytest.

## Install

```bash
pip install agentdog
pip install "agentdog[llm-judge]"  # optional LLM judging
```

## Quickstart

```python
from agentdog import AgentTrace, EvalRun, TestCase, ToolCall, run
from agentdog import ContainsAnswer, UsedTools, UnderTokenLimit

trace = AgentTrace(
    input="Summarize the Q3 report.",
    output="Revenue was $4.2M, up 12%.",
    tool_calls=[ToolCall(name="file_search", arguments={"query": "Q3 report"})],
    total_tokens=620,
)
case = TestCase("q3-summary", scorers=[
    ContainsAnswer(["4.2M", "12%"]),
    UsedTools(["file_search"]),
    UnderTokenLimit(1000),
])

report = run([EvalRun(case=case, trace=trace)])
report.print()
```

## CLI

Define `evals()` returning a list of `EvalRun` objects, then:

```bash
agentdog run my_evals.py -v
agentdog run my_evals.py --tag rag --fail-fast --json-out report.json
agentdog inspect trace.json
```

Exit codes: `0` for no failures/errors, `1` otherwise. Fail-fast evaluates each
scorer once and still exports a partial report.

## pytest

```python
from agentdog import AgentTrace, ContainsAnswer, assert_evaluates

def test_capital():
    trace = AgentTrace(input="Capital of France?", output="Paris")
    assert_evaluates(trace, [ContainsAnswer(["Paris"])])
```

The helper reports scorer failures and rejects skipped checks unless
`allow_skips=True`.

## Scorers

| Category | Scorers |
| --- | --- |
| Answer | `ContainsAnswer`, `ExactAnswer`, `RegexAnswer`, `ForbiddenContent`, `AnswerNotEmpty` |
| Tools | `UsedTools`, `AvoidedTools`, `ToolCallOrder`, `MaxToolCalls`, `ToolArgContains`, `ToolArgEquals` |
| Grounding | `GroundedInContext`, `CitedSource`, `NoContextHallucination` |
| Safety | `NoSensitiveDataLeaked`, `NoRiskyActionTaken`, `PromptInjectionResisted` |
| Efficiency | `UnderTokenLimit`, `UnderCostLimit`, `UnderLatencyLimit`, `MaxRetries` |
| LLM judge | `LLMJudge` |

Results have `pass`, `fail`, `skip`, or `error` status. Missing efficiency metrics
default to `skip`; use `missing="fail"` to require them or `missing="pass"` for
legacy behavior. Skips are non-blocking in reports; skips/errors have no numeric
score and are excluded from averages. Reports include evaluated coverage.

Extend `Scorer` with a `score(trace)` method returning `ScoreResult` to add checks.

See [sample evaluations](examples/sample_evals.py), the
[pytest example](examples/test_agent_behavior.py), and
[CI/release setup](.github/README.md).

Created by **Sai Teja Erukude**. [MIT License](LICENSE).
