Skip to content

Refactor tool schemas to use pydantic-ai toolsets #2

Description

@cancelself

Follow-up from PR #1 review by @milani.

Context

src/rules_agent/rules/eval.py:105-107 (and similar sites like src/rules_agent/rules/extractor.py) hand-roll OpenAI-compatible tool schemas as dict literals. pydantic-ai tools/toolsets would let us define these as typed Python objects and make the code more idiomatic.

Scope

  • Evaluate whether pydantic-ai plays nicely with the existing OpenAI-SDK-based multi-provider setup (Ollama, OpenAI, Anthropic).
  • Migrate the eval judge tool schema and the extractor tool schema to pydantic-ai toolsets.
  • Update tests in tests/test_eval.py and tests/test_extractor.py to match.

Notes

Original review comment: #1 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions