Skip to main content
Glama

mcp-run-python

Official
by pydantic
test.md792 B
# `pydantic_ai.models.test` Utility model for quickly testing apps built with Pydantic AI. Here's a minimal example: ```py {title="test_model_usage.py" call_name="test_my_agent" noqa="I001"} from pydantic_ai import Agent from pydantic_ai.models.test import TestModel my_agent = Agent('openai:gpt-4o', system_prompt='...') async def test_my_agent(): """Unit test for my_agent, to be run by pytest.""" m = TestModel() with my_agent.override(model=m): result = await my_agent.run('Testing my agent...') assert result.output == 'success (no tool calls)' assert m.last_model_request_parameters.function_tools == [] ``` See [Unit testing with `TestModel`](../../testing.md#unit-testing-with-testmodel) for detailed documentation. ::: pydantic_ai.models.test

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pydantic/pydantic-ai'

If you have feedback or need assistance with the MCP directory API, please join our Discord server