chore: import upstream snapshot with attribution
Harness Compat / harness compat (push) Failing after 0s
CI / test on 3.12 (standard) (push) Has been cancelled
CI / test on 3.13 (standard) (push) Has been cancelled
CI / test on 3.14 (standard) (push) Has been cancelled
CI / test on 3.10 (all-extras) (push) Has been cancelled
CI / test on 3.11 (all-extras) (push) Has been cancelled
CI / test on 3.12 (all-extras) (push) Has been cancelled
CI / test on 3.14 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.10 (pydantic-evals) (push) Has been cancelled
CI / test on 3.11 (pydantic-evals) (push) Has been cancelled
CI / test on 3.12 (pydantic-evals) (push) Has been cancelled
CI / deploy-docs-preview (push) Has been cancelled
CI / build release artifacts (push) Has been cancelled
CI / publish to PyPI (push) Has been cancelled
CI / Send tweet (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / mypy (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / test on 3.10 (standard) (push) Has been cancelled
CI / test on 3.11 (standard) (push) Has been cancelled
CI / test on 3.13 (all-extras) (push) Has been cancelled
CI / test on 3.14 (all-extras) (push) Has been cancelled
CI / test on 3.10 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.11 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.12 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.13 (pydantic-ai-slim) (push) Has been cancelled
CI / test on 3.13 (pydantic-evals) (push) Has been cancelled
CI / test on 3.14 (pydantic-evals) (push) Has been cancelled
CI / test on 3.10 (lowest-versions) (push) Has been cancelled
CI / test on 3.11 (lowest-versions) (push) Has been cancelled
CI / test on 3.12 (lowest-versions) (push) Has been cancelled
CI / test on 3.13 (lowest-versions) (push) Has been cancelled
CI / test on 3.14 (lowest-versions) (push) Has been cancelled
CI / test examples on 3.11 (push) Has been cancelled
CI / test examples on 3.12 (push) Has been cancelled
CI / test examples on 3.13 (push) Has been cancelled
CI / test examples on 3.14 (push) Has been cancelled
CI / coverage (push) Has been cancelled
CI / check (push) Has been cancelled
CI / deploy-docs (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:27:52 +08:00
commit 9201ef759e
2096 changed files with 1232387 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
# `pydantic_ai.agent`
::: pydantic_ai.agent
options:
members:
- Agent
- AbstractAgent
- WrapperAgent
- AgentRetries
- AgentRun
- AgentRunResult
- EndStrategy
- RunOutputDataT
- capture_run_messages
- InstrumentationSettings
- EventStreamHandler
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.capabilities`
::: pydantic_ai.capabilities
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.common_tools`
::: pydantic_ai.common_tools.duckduckgo
::: pydantic_ai.common_tools.exa
::: pydantic_ai.common_tools.tavily
+15
View File
@@ -0,0 +1,15 @@
# `pydantic_ai` — Concurrency
::: pydantic_ai.ConcurrencyLimitedModel
::: pydantic_ai.limit_model_concurrency
::: pydantic_ai.AbstractConcurrencyLimiter
::: pydantic_ai.ConcurrencyLimiter
::: pydantic_ai.ConcurrencyLimit
::: pydantic_ai.AnyConcurrencyLimit
::: pydantic_ai.ConcurrencyLimitExceeded
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.direct`
::: pydantic_ai.direct
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.durable_exec`
::: pydantic_ai.durable_exec.temporal
::: pydantic_ai.durable_exec.dbos
::: pydantic_ai.durable_exec.prefect
+27
View File
@@ -0,0 +1,27 @@
# `pydantic_ai.embeddings`
::: pydantic_ai.embeddings
::: pydantic_ai.embeddings.base
::: pydantic_ai.embeddings.result
::: pydantic_ai.embeddings.settings
::: pydantic_ai.embeddings.openai
::: pydantic_ai.embeddings.cohere
::: pydantic_ai.embeddings.google
::: pydantic_ai.embeddings.bedrock
::: pydantic_ai.embeddings.voyageai
::: pydantic_ai.embeddings.sentence_transformers
::: pydantic_ai.embeddings.test
::: pydantic_ai.embeddings.wrapper
::: pydantic_ai.embeddings.instrumented
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.exceptions`
::: pydantic_ai.exceptions
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.ext`
::: pydantic_ai.ext.langchain
+6
View File
@@ -0,0 +1,6 @@
# `pydantic_ai.format_prompt`
::: pydantic_ai.format_prompt
options:
members:
- format_as_xml
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.function_signature`
::: pydantic_ai.function_signature
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.mcp`
::: pydantic_ai.mcp
+20
View File
@@ -0,0 +1,20 @@
# `pydantic_ai.messages`
The structure of [`ModelMessage`][pydantic_ai.messages.ModelMessage] can be shown as a graph:
```mermaid
graph RL
SystemPromptPart(SystemPromptPart) --- ModelRequestPart
UserPromptPart(UserPromptPart) --- ModelRequestPart
ToolReturnPart(ToolReturnPart) --- ModelRequestPart
RetryPromptPart(RetryPromptPart) --- ModelRequestPart
TextPart(TextPart) --- ModelResponsePart
ToolCallPart(ToolCallPart) --- ModelResponsePart
ThinkingPart(ThinkingPart) --- ModelResponsePart
ModelRequestPart("ModelRequestPart<br>(Union)") --- ModelRequest
ModelRequest("ModelRequest(parts=list[...])") --- ModelMessage
ModelResponsePart("ModelResponsePart<br>(Union)") --- ModelResponse
ModelResponse("ModelResponse(parts=list[...])") --- ModelMessage("ModelMessage<br>(Union)")
```
::: pydantic_ai.messages
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.anthropic`
## Setup
For details on how to set up authentication with this model, see [model configuration for Anthropic](../../models/anthropic.md).
::: pydantic_ai.models.anthropic
+14
View File
@@ -0,0 +1,14 @@
# `pydantic_ai.models`
::: pydantic_ai.models
options:
members:
- KnownModelName
- known_model_names
- ModelRequestParameters
- Model
- AbstractToolDefinition
- StreamedResponse
- ALLOW_MODEL_REQUESTS
- check_allow_model_requests
- override_allow_model_requests
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.bedrock`
## Setup
For details on how to set up authentication with this model, see [model configuration for Bedrock](../../models/bedrock.md).
::: pydantic_ai.models.bedrock
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.cerebras`
## Setup
For details on how to set up authentication with this model, see [model configuration for Cerebras](../../models/cerebras.md).
::: pydantic_ai.models.cerebras
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.cohere`
## Setup
For details on how to set up authentication with this model, see [model configuration for Cohere](../../models/cohere.md).
::: pydantic_ai.models.cohere
+3
View File
@@ -0,0 +1,3 @@
# pydantic_ai.models.fallback
::: pydantic_ai.models.fallback
+64
View File
@@ -0,0 +1,64 @@
# `pydantic_ai.models.function`
A model controlled by a local function.
[`FunctionModel`][pydantic_ai.models.function.FunctionModel] is similar to [`TestModel`](test.md),
but allows greater control over the model's behavior.
Its primary use case is for more advanced unit testing than is possible with `TestModel`.
Here's a minimal example:
```py {title="function_model_usage.py" call_name="test_my_agent" noqa="I001"}
from pydantic_ai import Agent
from pydantic_ai import ModelMessage, ModelResponse, TextPart
from pydantic_ai.models.function import FunctionModel, AgentInfo
my_agent = Agent('openai:gpt-5.2')
async def model_function(
messages: list[ModelMessage], info: AgentInfo
) -> ModelResponse:
print(messages)
"""
[
ModelRequest(
parts=[
UserPromptPart(
content='Testing my agent...',
timestamp=datetime.datetime(...),
)
],
timestamp=datetime.datetime(...),
run_id='...',
conversation_id='...',
)
]
"""
print(info)
"""
AgentInfo(
function_tools=[],
allow_text_output=True,
output_tools=[],
model_settings=None,
model_request_parameters=ModelRequestParameters(
function_tools=[], native_tools=[], output_tools=[]
),
instructions=None,
)
"""
return ModelResponse(parts=[TextPart('hello world')])
async def test_my_agent():
"""Unit test for my_agent, to be run by pytest."""
with my_agent.override(model=FunctionModel(model_function)):
result = await my_agent.run('Testing my agent...')
assert result.output == 'hello world'
```
See [Unit testing with `FunctionModel`](../../testing.md#unit-testing-with-functionmodel) for detailed documentation.
::: pydantic_ai.models.function
+10
View File
@@ -0,0 +1,10 @@
# `pydantic_ai.models.google`
Interface that uses the [`google-genai`](https://pypi.org/project/google-genai/) package under the hood to
access Google's Gemini models via both the Gemini API and Google Cloud (formerly known as Vertex AI).
## Setup
For details on how to set up authentication with this model, see [model configuration for Google](../../models/google.md).
::: pydantic_ai.models.google
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.groq`
## Setup
For details on how to set up authentication with this model, see [model configuration for Groq](../../models/groq.md).
::: pydantic_ai.models.groq
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.huggingface`
## Setup
For details on how to set up authentication with this model, see [model configuration for Hugging Face](../../models/huggingface.md).
::: pydantic_ai.models.huggingface
+3
View File
@@ -0,0 +1,3 @@
# pydantic_ai.models.instrumented
::: pydantic_ai.models.instrumented
+3
View File
@@ -0,0 +1,3 @@
# pydantic_ai.models.mcp_sampling
::: pydantic_ai.models.mcp_sampling
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.mistral`
## Setup
For details on how to set up authentication with this model, see [model configuration for Mistral](../../models/mistral.md).
::: pydantic_ai.models.mistral
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.ollama`
## Setup
For details on how to set up authentication with this model, see [model configuration for Ollama](../../models/ollama.md).
::: pydantic_ai.models.ollama
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.openai`
## Setup
For details on how to set up authentication with this model, see [model configuration for OpenAI](../../models/openai.md).
::: pydantic_ai.models.openai
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.openrouter`
## Setup
For details on how to set up authentication with this model, see [model configuration for OpenRouter](../../models/openrouter.md).
::: pydantic_ai.models.openrouter
+25
View File
@@ -0,0 +1,25 @@
# `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-5.2', instructions='...')
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
+3
View File
@@ -0,0 +1,3 @@
# pydantic_ai.models.wrapper
::: pydantic_ai.models.wrapper
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.xai`
## Setup
For details on how to set up authentication with this model, see [model configuration for xAI](../../models/xai.md).
::: pydantic_ai.models.xai
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.models.zai`
## Setup
For details on how to set up authentication with this model, see [model configuration for Z.AI](../../models/zai.md).
::: pydantic_ai.models.zai
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.native_tools`
::: pydantic_ai.native_tools
+13
View File
@@ -0,0 +1,13 @@
# `pydantic_ai.output`
::: pydantic_ai.output
options:
inherited_members: true
members:
- OutputDataT
- ToolOutput
- NativeOutput
- PromptedOutput
- TextOutput
- StructuredDict
- DeferredToolRequests
+33
View File
@@ -0,0 +1,33 @@
# `pydantic_ai.profiles`
::: pydantic_ai.profiles
options:
members:
- ModelProfile
- ModelProfileSpec
- merge_profile
- DEFAULT_PROFILE
- DEFAULT_PROMPTED_OUTPUT_TEMPLATE
- DEFAULT_THINKING_TAGS
::: pydantic_ai.profiles.openai
::: pydantic_ai.profiles.anthropic
::: pydantic_ai.profiles.google
::: pydantic_ai.profiles.meta
::: pydantic_ai.profiles.amazon
::: pydantic_ai.profiles.deepseek
::: pydantic_ai.profiles.grok
::: pydantic_ai.profiles.mistral
::: pydantic_ai.profiles.qwen
::: pydantic_ai.profiles.groq
::: pydantic_ai.profiles.zai
+59
View File
@@ -0,0 +1,59 @@
# `pydantic_ai.providers`
::: pydantic_ai.providers.Provider
::: pydantic_ai.providers.gateway.gateway_provider
::: pydantic_ai.providers.anthropic.AnthropicProvider
::: pydantic_ai.providers.google
::: pydantic_ai.providers.openai
::: pydantic_ai.providers.xai
::: pydantic_ai.providers.deepseek
::: pydantic_ai.providers.bedrock
::: pydantic_ai.providers.groq
::: pydantic_ai.providers.azure
::: pydantic_ai.providers.cohere
::: pydantic_ai.providers.voyageai.VoyageAIProvider
::: pydantic_ai.providers.cerebras.CerebrasProvider
::: pydantic_ai.providers.mistral.MistralProvider
::: pydantic_ai.providers.fireworks.FireworksProvider
::: pydantic_ai.providers.together.TogetherProvider
::: pydantic_ai.providers.heroku.HerokuProvider
::: pydantic_ai.providers.github.GitHubProvider
::: pydantic_ai.providers.openrouter.OpenRouterProvider
::: pydantic_ai.providers.vercel.VercelProvider
::: pydantic_ai.providers.huggingface.HuggingFaceProvider
::: pydantic_ai.providers.moonshotai.MoonshotAIProvider
::: pydantic_ai.providers.ollama.OllamaProvider
::: pydantic_ai.providers.litellm.LiteLLMProvider
::: pydantic_ai.providers.nebius.NebiusProvider
::: pydantic_ai.providers.ovhcloud.OVHcloudProvider
::: pydantic_ai.providers.alibaba.AlibabaProvider
::: pydantic_ai.providers.sambanova.SambaNovaProvider
::: pydantic_ai.providers.zai.ZaiProvider
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_evals.dataset`
::: pydantic_evals.dataset
+5
View File
@@ -0,0 +1,5 @@
# `pydantic_evals.evaluators`
::: pydantic_evals.evaluators
::: pydantic_evals.evaluators.llm_as_a_judge
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_evals.generation`
::: pydantic_evals.generation
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_evals.lifecycle`
::: pydantic_evals.lifecycle
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_evals.online`
::: pydantic_evals.online
@@ -0,0 +1,3 @@
# `pydantic_evals.online_capability`
::: pydantic_evals.online_capability
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_evals.otel`
::: pydantic_evals.otel
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_evals.reporting`
::: pydantic_evals.reporting
+13
View File
@@ -0,0 +1,13 @@
# `pydantic_graph.basenode`
::: pydantic_graph.basenode
options:
members:
- StateT
- GraphRunContext
- BaseNode
- End
- Edge
- DepsT
- RunEndT
- NodeRunEndT
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_graph.decision`
::: pydantic_graph.decision
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_graph.exceptions`
::: pydantic_graph.exceptions
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_graph.graph_builder`
::: pydantic_graph.graph_builder
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_graph.join`
::: pydantic_graph.join
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_graph.node`
::: pydantic_graph.node
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_graph.step`
::: pydantic_graph.step
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_graph.util`
::: pydantic_graph.util
+8
View File
@@ -0,0 +1,8 @@
# `pydantic_ai.result`
::: pydantic_ai.result
options:
inherited_members: true
members:
- StreamedRunResult
- StreamedRunResultSync
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.retries`
::: pydantic_ai.retries
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.run`
::: pydantic_ai.run
+8
View File
@@ -0,0 +1,8 @@
# `pydantic_ai.settings`
::: pydantic_ai.settings
options:
inherited_members: true
members:
- ModelSettings
- ToolOrOutput
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.tools`
::: pydantic_ai.tools
+19
View File
@@ -0,0 +1,19 @@
# `pydantic_ai.toolsets`
::: pydantic_ai.toolsets
options:
members:
- AbstractToolset
- CombinedToolset
- ExternalToolset
- ApprovalRequiredToolset
- FilteredToolset
- FunctionToolset
- IncludeReturnSchemasToolset
- DeferredLoadingToolset
- PrefixedToolset
- RenamedToolset
- SetMetadataToolset
- PreparedToolset
- WrapperToolset
- ToolsetFunc
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.ui.ag_ui`
::: pydantic_ai.ui.ag_ui
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.ui`
::: pydantic_ai.ui
+7
View File
@@ -0,0 +1,7 @@
# `pydantic_ai.ui.vercel_ai`
::: pydantic_ai.ui.vercel_ai
::: pydantic_ai.ui.vercel_ai.request_types
::: pydantic_ai.ui.vercel_ai.response_types
+3
View File
@@ -0,0 +1,3 @@
# `pydantic_ai.usage`
::: pydantic_ai.usage