Skip to main content
Glama

mcp-run-python

Official
by pydantic
pydantic-model.md715 B
# Pydantic Model Simple example of using Pydantic AI to construct a Pydantic model from a text input. Demonstrates: - [structured `output_type`](../output.md#structured-output) ## Running the Example With [dependencies installed and environment variables set](./setup.md#usage), run: ```bash python/uv-run -m pydantic_ai_examples.pydantic_model ``` This examples uses `openai:gpt-4o` by default, but it works well with other models, e.g. you can run it with Gemini using: ```bash PYDANTIC_AI_MODEL=gemini-1.5-pro python/uv-run -m pydantic_ai_examples.pydantic_model ``` (or `PYDANTIC_AI_MODEL=gemini-1.5-flash ...`) ## Example Code ```snippet {path="/examples/pydantic_ai_examples/pydantic_model.py"}```

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