SKILL

pydantic-ai

使用 PydanticAI 构建可用于生产的 AI 智能体,涵盖类型安全的工具调用、结构化输出、依赖注入和多模型支持。

译文已校对
查看英文原文

Build production-ready AI agents with PydanticAI — type-safe tool use, structured outputs, dependency injection, and multi-model support.

适用对象:学习与科研。自动收录 · 待核查。

原作者说明节选

从固定版本的 SKILL.md 提取,保留原文语言。以下内容属于作者说明,本站尚未验证安装、兼容或运行结果。

查看英文原文

原文涵盖的主题

  • PydanticAI — Typed AI Agents in Python
  • Overview
  • When to Use This Skill
  • How It Works
  • Step 1: Installation
  • Step 2: A Minimal Agent
  • Step 3: Structured Output with Pydantic Models
  • Step 4: Tool Use

PydanticAI is a Python agent framework from the Pydantic team that brings the same type-safety and validation guarantees as Pydantic to LLM-based applications. It supports structured outputs (validated with Pydantic models), dependency injection for testability, streamed responses, multi-turn conversations, and tool use — across OpenAI, Anthropic, Google Gemini, Groq, Mistral, and Ollama. Use this skill when building production AI agents, chatbots, or LLM pipelines where correctness and testability matter. Use when building Python AI agents that call tools and return structured data Use when you need validated, typed LLM outputs (not raw strings) Use when you want to write unit tests for agent logic without hitting a real LLM Use when switching between LLM providers without rewriting agent code Use when the user asks about Agent, @agent.tool, RunContext, ModelRetry, or resulttype Register tools with @agent.tool — the LLM can call them during a run: Inject services (database, HTTP clients, config) into agents for testability: Write unit tests without real LLM calls: FunctionModel for deterministic test responses: ✅ Always define resulttype with a Pydantic model — avoid returning raw

这里只展示节选,请以完整原文和当前要求为准。

来源仓库
davila7/claude-code-templates
源文件
cli-tool/components/skills/ai-research/pydantic-ai/SKILL.md
固定版本
21be197f100a12b8d0dd9a211cc244c8179f84d3
阅读完整原作者说明 ↗

来源与内容状态

本条为自动发现的元数据,尚未完成人工文档核查;适用性与运行结果待核查。

原作者:davila7/claude-code-templates · 原作者仓库元数据。文档核查:未核查。最近来源检查:2026-11-09T14:01:43.393Z。

分类由名称、说明与路径规则生成,分类不代表已核实适配。

许可与权利归属

MIT。第三方内容及版权归原作者,使用条件以原文为准。

许可原文 ↗

本站没有因同步、复制或用户自报成功而将资源标为运行验证通过。

限制与注意事项

  • 元数据收录不代表本站已经安装、适配、实测或进行安全审查。