Skip to content

Recipe: Minimal Agent Run

Goal

Create an Agent and execute a minimal prompt.

Example

from doc_processing_toolkit import Agent

agent = Agent(
    model="claude-sonnet-4-5",
    instructions="You are concise.",
)

result = await agent.run("What is the capital of France?")
print(result.output)

What to validate

  • result.error is None
  • result.output is non-empty
  • token and cost fields are populated

Optional debug checks:

  • inspect result.input_tokens, result.output_tokens
  • inspect result.cost and result.cost_estimated

Test sources

  • tests/e2e/test_agent_e2e.py (test_simple_qa_anthropic, test_simple_qa_openai, test_simple_qa_google, test_simple_qa_fireworks)