Token导航 LogoToken导航TokenDH.com
AI 工具external-servicegithub未标认证来源可访问clear审计提醒

pydanticai-docspydanticai 文档

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

2,043

周安装

86

GitHub Stars

260

下载量

716
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pydanticai-docs(pydanticai 文档)
来源仓库:https://github.com/dougtrajano/pydantic-ai-skills
仓库路径:skills/pydanticai-docs
安装命令:
npx skills add https://github.com/dougtrajano/pydantic-ai-skills --skill pydanticai-docs
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/dougtrajano/pydantic-ai-skills --skill pydanticai-docs

简介

用于辅助文档、README 和 Markdown 内容的整理与改写。

  • 适合提炼结构、补齐章节、统一术语或检查链接有效性。pydanticai-docs 属于AI 工具类 Skill,可作为该场景下的辅助能力补充。
  • 使用时应保留项目已有事实,避免将未确认信息写成确定结论。
  • 涉及对外文案时,需控制语气,防止过度营销或夸大能力。
  • 安装前建议核对来源仓库与权限范围,确保操作安全合规。

SKILL.md

Pydantic AI Documentation Skill

What is Pydantic AI?

Pydantic AI is a production-grade Python agent framework for building type-safe, dependency-injected Generative AI applications. It supports multiple LLM providers, structured outputs via Pydantic models, and composable multi-agent patterns.

Doc: https://ai.pydantic.dev/index.md


Core Concepts

1. Agent Instantiation

from pydantic_ai import Agent

agent = Agent(
    'openai:gpt-4o',          # model string: provider:model-name
    system_prompt='Be helpful.',
)
result = agent.run_sync('What is the capital of France?')
print(result.output)

For full constructor parameters, run methods, and streaming: load references/AGENT.md.

2. Function Tools (@agent.tool)

from pydantic_ai import Agent, RunContext

agent = Agent('openai:gpt-4o', deps_type=str)

@agent.tool
def get_user_name(ctx: RunContext[str]) -> str:
    """Return the current user's name."""
    return ctx.deps

result = agent.run_sync('What is my name?', deps='Alice')

Use @agent.tool_plain when you don't need RunContext. For tool registration, return types, and retries: load references/FUNCTION_TOOLS.md.

3. Dependency Injection (RunContext)

from dataclasses import dataclass
from pydantic_ai import Agent, RunContext

@dataclass
class MyDeps:
    api_key: str
    user_id: int

agent = Agent('openai:gpt-4o', deps_type=MyDeps)

@agent.tool
async def fetch_data(ctx: RunContext[MyDeps]) -> str:
    return f'User {ctx.deps.user_id}'

For RunContext fields, injection into system prompts and output validators: load references/DEPENDENCIES.md.

4. Structured Output

from pydantic import BaseModel
from pydantic_ai import Agent

class CityInfo(BaseModel):
    city: str
    country: str

agent = Agent('openai:gpt-4o', output_type=CityInfo)
result = agent.run_sync('Where were the 2012 Olympics held?')
print(result.output)  # CityInfo(city='London', country='United Kingdom')

For union types, plain scalars, output_validator, and partial validation: load references/OUTPUT.md.


Additional Topics

For these topics, load the named reference file or follow the doc link — no implementation code is provided here.
TopicReference fileDoc link
Message history / multi-turn conversationsreferences/MESSAGES.mdhttps://ai.pydantic.dev/message-history/index.md
Model / provider setup (all providers)references/MODELS.mdhttps://ai.pydantic.dev/models/overview/index.md
Toolsets (FunctionToolset, composition)references/TOOLS_AND_TOOLSETS.mdhttps://ai.pydantic.dev/toolsets/index.md
MCP server integrationreferences/MCP.mdhttps://ai.pydantic.dev/mcp/client/index.md
Multi-agent applicationsdoc link onlyhttps://ai.pydantic.dev/multi-agent-applications/index.md
Graphs (pydantic-graph)doc link onlyhttps://ai.pydantic.dev/graph/index.md
Evals (pydantic-evals)doc link onlyhttps://ai.pydantic.dev/evals/index.md
Durable executiondoc link onlyhttps://ai.pydantic.dev/durable_execution/overview/index.md
Retriesdoc link onlyhttps://ai.pydantic.dev/retries/index.md
Testing (TestModel, override)doc link onlyhttps://ai.pydantic.dev/testing/index.md
Logfire integrationdoc link onlyhttps://ai.pydantic.dev/logfire/index.md
Builtin toolsdoc link onlyhttps://ai.pydantic.dev/builtin-tools/index.md
Streamingdoc link onlyhttps://ai.pydantic.dev/agent/index.md

Agent Behavior Rules

  1. Default to this file — answer from core concepts first; load only the specific references/<CONCEPT>.md relevant to the user's question when more depth is needed.
  2. Never fabricate API details — always end with "For details, see: <URL>" using a link from the official index above.
  3. No implementation code for non-core topics — return a doc link only for topics listed in the Additional Topics table.
  4. Prefer specificity — route to the most specific page (e.g., models/anthropic/index.md) when the user's question targets a specific provider, not the overview.
  5. Out of scope — do not debug user code passively, do not generate full production agent implementations, do not answer questions unrelated to the Pydantic AI ecosystem.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

28.79%
按下载量换算206

Antigravity

25.03%
按下载量换算179

Gemini CLI

20.74%
按下载量换算148

github-copilot

12.27%
按下载量换算88

Claude Code

8.17%
按下载量换算58

windsurf

3.5%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills