pydantic-ai-slim 1.0.10__tar.gz → 1.0.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pydantic-ai-slim might be problematic. Click here for more details.
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/PKG-INFO +6 -6
- pydantic_ai_slim-1.0.12/pydantic_ai/__init__.py +215 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_a2a.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_function_schema.py +18 -10
- {pydantic_ai_slim-1.0.10/pydantic_ai/profiles → pydantic_ai_slim-1.0.12/pydantic_ai}/_json_schema.py +5 -3
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_output.py +1 -8
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_thinking_part.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_utils.py +24 -7
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/agent/__init__.py +1 -2
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/builtin_tools.py +20 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/common_tools/duckduckgo.py +2 -2
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/common_tools/tavily.py +2 -2
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/direct.py +4 -4
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/dbos/_agent.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/dbos/_mcp_server.py +1 -2
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/dbos/_model.py +2 -2
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_agent.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_function_toolset.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_mcp_server.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_model.py +3 -3
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_toolset.py +1 -3
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/ext/aci.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/ext/langchain.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/mcp.py +21 -7
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/messages.py +16 -11
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/__init__.py +3 -82
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/anthropic.py +36 -23
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/bedrock.py +6 -5
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/google.py +2 -2
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/instrumented.py +27 -11
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/openai.py +115 -33
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/output.py +23 -2
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/__init__.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/google.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/harmony.py +3 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/openai.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/__init__.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/anthropic.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/azure.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/bedrock.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/cerebras.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/cohere.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/deepseek.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/fireworks.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/github.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/google.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/google_gla.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/google_vertex.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/grok.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/groq.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/heroku.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/huggingface.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/litellm.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/mistral.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/moonshotai.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/ollama.py +3 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/openai.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/openrouter.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/together.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/vercel.py +1 -1
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/function.py +1 -2
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pyproject.toml +3 -3
- pydantic_ai_slim-1.0.10/pydantic_ai/__init__.py +0 -85
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/.gitignore +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/LICENSE +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/README.md +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/__main__.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_agent_graph.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_cli.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_griffe.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_mcp.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_otel_messages.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_parts_manager.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_run_context.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_system_prompt.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/_tool_manager.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/ag_ui.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/agent/abstract.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/agent/wrapper.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/common_tools/__init__.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/__init__.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/dbos/__init__.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/dbos/_utils.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/__init__.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_logfire.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_run_context.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/exceptions.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/ext/__init__.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/format_prompt.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/cohere.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/fallback.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/function.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/gemini.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/groq.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/huggingface.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/mcp_sampling.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/mistral.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/test.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/models/wrapper.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/amazon.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/anthropic.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/cohere.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/deepseek.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/grok.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/groq.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/meta.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/mistral.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/moonshotai.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/profiles/qwen.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/providers/gateway.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/py.typed +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/result.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/retries.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/run.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/settings.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/tools.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/__init__.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/_dynamic.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/abstract.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/approval_required.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/combined.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/external.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/filtered.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/prefixed.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/prepared.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/renamed.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/toolsets/wrapper.py +0 -0
- {pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/usage.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pydantic-ai-slim
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.12
|
|
4
4
|
Summary: Agent Framework / shim to use Pydantic with LLMs, slim package
|
|
5
5
|
Project-URL: Homepage, https://github.com/pydantic/pydantic-ai/tree/main/pydantic_ai_slim
|
|
6
6
|
Project-URL: Source, https://github.com/pydantic/pydantic-ai/tree/main/pydantic_ai_slim
|
|
@@ -29,11 +29,11 @@ Classifier: Topic :: Internet
|
|
|
29
29
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
30
30
|
Requires-Python: >=3.10
|
|
31
31
|
Requires-Dist: exceptiongroup; python_version < '3.11'
|
|
32
|
-
Requires-Dist: genai-prices>=0.0.
|
|
32
|
+
Requires-Dist: genai-prices>=0.0.28
|
|
33
33
|
Requires-Dist: griffe>=1.3.2
|
|
34
34
|
Requires-Dist: httpx>=0.27
|
|
35
35
|
Requires-Dist: opentelemetry-api>=1.28.0
|
|
36
|
-
Requires-Dist: pydantic-graph==1.0.
|
|
36
|
+
Requires-Dist: pydantic-graph==1.0.12
|
|
37
37
|
Requires-Dist: pydantic>=2.10
|
|
38
38
|
Requires-Dist: typing-inspection>=0.4.0
|
|
39
39
|
Provides-Extra: a2a
|
|
@@ -42,7 +42,7 @@ Provides-Extra: ag-ui
|
|
|
42
42
|
Requires-Dist: ag-ui-protocol>=0.1.8; extra == 'ag-ui'
|
|
43
43
|
Requires-Dist: starlette>=0.45.3; extra == 'ag-ui'
|
|
44
44
|
Provides-Extra: anthropic
|
|
45
|
-
Requires-Dist: anthropic>=0.
|
|
45
|
+
Requires-Dist: anthropic>=0.69.0; extra == 'anthropic'
|
|
46
46
|
Provides-Extra: bedrock
|
|
47
47
|
Requires-Dist: boto3>=1.39.0; extra == 'bedrock'
|
|
48
48
|
Provides-Extra: cli
|
|
@@ -57,7 +57,7 @@ Requires-Dist: dbos>=1.14.0; extra == 'dbos'
|
|
|
57
57
|
Provides-Extra: duckduckgo
|
|
58
58
|
Requires-Dist: ddgs>=9.0.0; extra == 'duckduckgo'
|
|
59
59
|
Provides-Extra: evals
|
|
60
|
-
Requires-Dist: pydantic-evals==1.0.
|
|
60
|
+
Requires-Dist: pydantic-evals==1.0.12; extra == 'evals'
|
|
61
61
|
Provides-Extra: google
|
|
62
62
|
Requires-Dist: google-genai>=1.31.0; extra == 'google'
|
|
63
63
|
Provides-Extra: groq
|
|
@@ -77,7 +77,7 @@ Requires-Dist: tenacity>=8.2.3; extra == 'retries'
|
|
|
77
77
|
Provides-Extra: tavily
|
|
78
78
|
Requires-Dist: tavily-python>=0.5.0; extra == 'tavily'
|
|
79
79
|
Provides-Extra: temporal
|
|
80
|
-
Requires-Dist: temporalio==1.
|
|
80
|
+
Requires-Dist: temporalio==1.18.0; extra == 'temporal'
|
|
81
81
|
Provides-Extra: vertexai
|
|
82
82
|
Requires-Dist: google-auth>=2.36.0; extra == 'vertexai'
|
|
83
83
|
Requires-Dist: requests>=2.32.2; extra == 'vertexai'
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
from importlib.metadata import version as _metadata_version
|
|
2
|
+
|
|
3
|
+
from .agent import (
|
|
4
|
+
Agent,
|
|
5
|
+
CallToolsNode,
|
|
6
|
+
EndStrategy,
|
|
7
|
+
InstrumentationSettings,
|
|
8
|
+
ModelRequestNode,
|
|
9
|
+
UserPromptNode,
|
|
10
|
+
capture_run_messages,
|
|
11
|
+
)
|
|
12
|
+
from .builtin_tools import CodeExecutionTool, UrlContextTool, WebSearchTool, WebSearchUserLocation
|
|
13
|
+
from .exceptions import (
|
|
14
|
+
AgentRunError,
|
|
15
|
+
ApprovalRequired,
|
|
16
|
+
CallDeferred,
|
|
17
|
+
FallbackExceptionGroup,
|
|
18
|
+
ModelHTTPError,
|
|
19
|
+
ModelRetry,
|
|
20
|
+
UnexpectedModelBehavior,
|
|
21
|
+
UsageLimitExceeded,
|
|
22
|
+
UserError,
|
|
23
|
+
)
|
|
24
|
+
from .format_prompt import format_as_xml
|
|
25
|
+
from .messages import (
|
|
26
|
+
AgentStreamEvent,
|
|
27
|
+
AudioFormat,
|
|
28
|
+
AudioMediaType,
|
|
29
|
+
AudioUrl,
|
|
30
|
+
BaseToolCallPart,
|
|
31
|
+
BaseToolReturnPart,
|
|
32
|
+
BinaryContent,
|
|
33
|
+
BuiltinToolCallPart,
|
|
34
|
+
BuiltinToolReturnPart,
|
|
35
|
+
DocumentFormat,
|
|
36
|
+
DocumentMediaType,
|
|
37
|
+
DocumentUrl,
|
|
38
|
+
FileUrl,
|
|
39
|
+
FinalResultEvent,
|
|
40
|
+
FinishReason,
|
|
41
|
+
FunctionToolCallEvent,
|
|
42
|
+
FunctionToolResultEvent,
|
|
43
|
+
HandleResponseEvent,
|
|
44
|
+
ImageFormat,
|
|
45
|
+
ImageMediaType,
|
|
46
|
+
ImageUrl,
|
|
47
|
+
ModelMessage,
|
|
48
|
+
ModelMessagesTypeAdapter,
|
|
49
|
+
ModelRequest,
|
|
50
|
+
ModelRequestPart,
|
|
51
|
+
ModelResponse,
|
|
52
|
+
ModelResponsePart,
|
|
53
|
+
ModelResponsePartDelta,
|
|
54
|
+
ModelResponseStreamEvent,
|
|
55
|
+
MultiModalContent,
|
|
56
|
+
PartDeltaEvent,
|
|
57
|
+
PartStartEvent,
|
|
58
|
+
RetryPromptPart,
|
|
59
|
+
SystemPromptPart,
|
|
60
|
+
TextPart,
|
|
61
|
+
TextPartDelta,
|
|
62
|
+
ThinkingPart,
|
|
63
|
+
ThinkingPartDelta,
|
|
64
|
+
ToolCallPart,
|
|
65
|
+
ToolCallPartDelta,
|
|
66
|
+
ToolReturn,
|
|
67
|
+
ToolReturnPart,
|
|
68
|
+
UserContent,
|
|
69
|
+
UserPromptPart,
|
|
70
|
+
VideoFormat,
|
|
71
|
+
VideoMediaType,
|
|
72
|
+
VideoUrl,
|
|
73
|
+
)
|
|
74
|
+
from .output import NativeOutput, PromptedOutput, StructuredDict, TextOutput, ToolOutput
|
|
75
|
+
from .profiles import (
|
|
76
|
+
DEFAULT_PROFILE,
|
|
77
|
+
InlineDefsJsonSchemaTransformer,
|
|
78
|
+
JsonSchemaTransformer,
|
|
79
|
+
ModelProfile,
|
|
80
|
+
ModelProfileSpec,
|
|
81
|
+
)
|
|
82
|
+
from .settings import ModelSettings
|
|
83
|
+
from .tools import DeferredToolRequests, DeferredToolResults, RunContext, Tool, ToolApproved, ToolDefinition, ToolDenied
|
|
84
|
+
from .toolsets import (
|
|
85
|
+
AbstractToolset,
|
|
86
|
+
ApprovalRequiredToolset,
|
|
87
|
+
CombinedToolset,
|
|
88
|
+
ExternalToolset,
|
|
89
|
+
FilteredToolset,
|
|
90
|
+
FunctionToolset,
|
|
91
|
+
PrefixedToolset,
|
|
92
|
+
PreparedToolset,
|
|
93
|
+
RenamedToolset,
|
|
94
|
+
ToolsetFunc,
|
|
95
|
+
ToolsetTool,
|
|
96
|
+
WrapperToolset,
|
|
97
|
+
)
|
|
98
|
+
from .usage import RequestUsage, RunUsage, UsageLimits
|
|
99
|
+
|
|
100
|
+
__all__ = (
|
|
101
|
+
'__version__',
|
|
102
|
+
# agent
|
|
103
|
+
'Agent',
|
|
104
|
+
'EndStrategy',
|
|
105
|
+
'CallToolsNode',
|
|
106
|
+
'ModelRequestNode',
|
|
107
|
+
'UserPromptNode',
|
|
108
|
+
'capture_run_messages',
|
|
109
|
+
'InstrumentationSettings',
|
|
110
|
+
# exceptions
|
|
111
|
+
'AgentRunError',
|
|
112
|
+
'CallDeferred',
|
|
113
|
+
'ApprovalRequired',
|
|
114
|
+
'ModelRetry',
|
|
115
|
+
'ModelHTTPError',
|
|
116
|
+
'FallbackExceptionGroup',
|
|
117
|
+
'UnexpectedModelBehavior',
|
|
118
|
+
'UsageLimitExceeded',
|
|
119
|
+
'UserError',
|
|
120
|
+
# messages
|
|
121
|
+
'AgentStreamEvent',
|
|
122
|
+
'AudioFormat',
|
|
123
|
+
'AudioMediaType',
|
|
124
|
+
'AudioUrl',
|
|
125
|
+
'BaseToolCallPart',
|
|
126
|
+
'BaseToolReturnPart',
|
|
127
|
+
'BinaryContent',
|
|
128
|
+
'BuiltinToolCallPart',
|
|
129
|
+
'BuiltinToolReturnPart',
|
|
130
|
+
'DocumentFormat',
|
|
131
|
+
'DocumentMediaType',
|
|
132
|
+
'DocumentUrl',
|
|
133
|
+
'FileUrl',
|
|
134
|
+
'FinalResultEvent',
|
|
135
|
+
'FinishReason',
|
|
136
|
+
'FunctionToolCallEvent',
|
|
137
|
+
'FunctionToolResultEvent',
|
|
138
|
+
'HandleResponseEvent',
|
|
139
|
+
'ImageFormat',
|
|
140
|
+
'ImageMediaType',
|
|
141
|
+
'ImageUrl',
|
|
142
|
+
'ModelMessage',
|
|
143
|
+
'ModelMessagesTypeAdapter',
|
|
144
|
+
'ModelRequest',
|
|
145
|
+
'ModelRequestPart',
|
|
146
|
+
'ModelResponse',
|
|
147
|
+
'ModelResponsePart',
|
|
148
|
+
'ModelResponsePartDelta',
|
|
149
|
+
'ModelResponseStreamEvent',
|
|
150
|
+
'MultiModalContent',
|
|
151
|
+
'PartDeltaEvent',
|
|
152
|
+
'PartStartEvent',
|
|
153
|
+
'RetryPromptPart',
|
|
154
|
+
'SystemPromptPart',
|
|
155
|
+
'TextPart',
|
|
156
|
+
'TextPartDelta',
|
|
157
|
+
'ThinkingPart',
|
|
158
|
+
'ThinkingPartDelta',
|
|
159
|
+
'ToolCallPart',
|
|
160
|
+
'ToolCallPartDelta',
|
|
161
|
+
'ToolReturn',
|
|
162
|
+
'ToolReturnPart',
|
|
163
|
+
'UserContent',
|
|
164
|
+
'UserPromptPart',
|
|
165
|
+
'VideoFormat',
|
|
166
|
+
'VideoMediaType',
|
|
167
|
+
'VideoUrl',
|
|
168
|
+
# profiles
|
|
169
|
+
'ModelProfile',
|
|
170
|
+
'ModelProfileSpec',
|
|
171
|
+
'DEFAULT_PROFILE',
|
|
172
|
+
'InlineDefsJsonSchemaTransformer',
|
|
173
|
+
'JsonSchemaTransformer',
|
|
174
|
+
# tools
|
|
175
|
+
'Tool',
|
|
176
|
+
'ToolDefinition',
|
|
177
|
+
'RunContext',
|
|
178
|
+
'DeferredToolRequests',
|
|
179
|
+
'DeferredToolResults',
|
|
180
|
+
'ToolApproved',
|
|
181
|
+
'ToolDenied',
|
|
182
|
+
# toolsets
|
|
183
|
+
'AbstractToolset',
|
|
184
|
+
'ApprovalRequiredToolset',
|
|
185
|
+
'CombinedToolset',
|
|
186
|
+
'ExternalToolset',
|
|
187
|
+
'FilteredToolset',
|
|
188
|
+
'FunctionToolset',
|
|
189
|
+
'PrefixedToolset',
|
|
190
|
+
'PreparedToolset',
|
|
191
|
+
'RenamedToolset',
|
|
192
|
+
'ToolsetFunc',
|
|
193
|
+
'ToolsetTool',
|
|
194
|
+
'WrapperToolset',
|
|
195
|
+
# builtin_tools
|
|
196
|
+
'WebSearchTool',
|
|
197
|
+
'WebSearchUserLocation',
|
|
198
|
+
'UrlContextTool',
|
|
199
|
+
'CodeExecutionTool',
|
|
200
|
+
# output
|
|
201
|
+
'ToolOutput',
|
|
202
|
+
'NativeOutput',
|
|
203
|
+
'PromptedOutput',
|
|
204
|
+
'TextOutput',
|
|
205
|
+
'StructuredDict',
|
|
206
|
+
# format_prompt
|
|
207
|
+
'format_as_xml',
|
|
208
|
+
# settings
|
|
209
|
+
'ModelSettings',
|
|
210
|
+
# usage
|
|
211
|
+
'RunUsage',
|
|
212
|
+
'RequestUsage',
|
|
213
|
+
'UsageLimits',
|
|
214
|
+
)
|
|
215
|
+
__version__ = _metadata_version('pydantic_ai_slim')
|
|
@@ -231,31 +231,39 @@ R = TypeVar('R')
|
|
|
231
231
|
|
|
232
232
|
WithCtx = Callable[Concatenate[RunContext[Any], P], R]
|
|
233
233
|
WithoutCtx = Callable[P, R]
|
|
234
|
-
|
|
234
|
+
TargetCallable = WithCtx[P, R] | WithoutCtx[P, R]
|
|
235
235
|
|
|
236
236
|
|
|
237
|
-
def _takes_ctx(
|
|
238
|
-
"""Check if a
|
|
237
|
+
def _takes_ctx(callable_obj: TargetCallable[P, R]) -> TypeIs[WithCtx[P, R]]:
|
|
238
|
+
"""Check if a callable takes a `RunContext` first argument.
|
|
239
239
|
|
|
240
240
|
Args:
|
|
241
|
-
|
|
241
|
+
callable_obj: The callable to check.
|
|
242
242
|
|
|
243
243
|
Returns:
|
|
244
|
-
`True` if the
|
|
244
|
+
`True` if the callable takes a `RunContext` as first argument, `False` otherwise.
|
|
245
245
|
"""
|
|
246
246
|
try:
|
|
247
|
-
sig = signature(
|
|
248
|
-
except ValueError:
|
|
249
|
-
return False
|
|
247
|
+
sig = signature(callable_obj)
|
|
248
|
+
except ValueError:
|
|
249
|
+
return False
|
|
250
250
|
try:
|
|
251
251
|
first_param_name = next(iter(sig.parameters.keys()))
|
|
252
252
|
except StopIteration:
|
|
253
253
|
return False
|
|
254
254
|
else:
|
|
255
|
-
|
|
255
|
+
# See https://github.com/pydantic/pydantic/pull/11451 for a similar implementation in Pydantic
|
|
256
|
+
if not isinstance(callable_obj, _decorators._function_like): # pyright: ignore[reportPrivateUsage]
|
|
257
|
+
call_func = getattr(type(callable_obj), '__call__', None)
|
|
258
|
+
if call_func is not None:
|
|
259
|
+
callable_obj = call_func
|
|
260
|
+
else:
|
|
261
|
+
return False # pragma: no cover
|
|
262
|
+
|
|
263
|
+
type_hints = _typing_extra.get_function_type_hints(_decorators.unwrap_wrapped_function(callable_obj))
|
|
256
264
|
annotation = type_hints.get(first_param_name)
|
|
257
265
|
if annotation is None:
|
|
258
|
-
return False
|
|
266
|
+
return False
|
|
259
267
|
return True is not sig.empty and _is_call_ctx(annotation)
|
|
260
268
|
|
|
261
269
|
|
{pydantic_ai_slim-1.0.10/pydantic_ai/profiles → pydantic_ai_slim-1.0.12/pydantic_ai}/_json_schema.py
RENAMED
|
@@ -6,7 +6,7 @@ from copy import deepcopy
|
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
from typing import Any, Literal
|
|
8
8
|
|
|
9
|
-
from
|
|
9
|
+
from .exceptions import UserError
|
|
10
10
|
|
|
11
11
|
JsonSchema = dict[str, Any]
|
|
12
12
|
|
|
@@ -54,14 +54,14 @@ class JsonSchemaTransformer(ABC):
|
|
|
54
54
|
if not self.prefer_inlined_defs and self.defs:
|
|
55
55
|
handled['$defs'] = {k: self._handle(v) for k, v in self.defs.items()}
|
|
56
56
|
|
|
57
|
-
elif self.recursive_refs:
|
|
57
|
+
elif self.recursive_refs:
|
|
58
58
|
# If we are preferring inlined defs and there are recursive refs, we _have_ to use a $defs+$ref structure
|
|
59
59
|
# We try to use whatever the original root key was, but if it is already in use,
|
|
60
60
|
# we modify it to avoid collisions.
|
|
61
61
|
defs = {key: self.defs[key] for key in self.recursive_refs}
|
|
62
62
|
root_ref = self.schema.get('$ref')
|
|
63
63
|
root_key = None if root_ref is None else re.sub(r'^#/\$defs/', '', root_ref)
|
|
64
|
-
if root_key is None:
|
|
64
|
+
if root_key is None: # pragma: no cover
|
|
65
65
|
root_key = self.schema.get('title', 'root')
|
|
66
66
|
while root_key in defs:
|
|
67
67
|
# Modify the root key until it is not already in use
|
|
@@ -77,6 +77,8 @@ class JsonSchemaTransformer(ABC):
|
|
|
77
77
|
if self.prefer_inlined_defs:
|
|
78
78
|
while ref := schema.get('$ref'):
|
|
79
79
|
key = re.sub(r'^#/\$defs/', '', ref)
|
|
80
|
+
if key in self.recursive_refs:
|
|
81
|
+
break
|
|
80
82
|
if key in self.refs_stack:
|
|
81
83
|
self.recursive_refs.add(key)
|
|
82
84
|
break # recursive ref can't be unpacked
|
|
@@ -19,6 +19,7 @@ from .output import (
|
|
|
19
19
|
NativeOutput,
|
|
20
20
|
OutputDataT,
|
|
21
21
|
OutputMode,
|
|
22
|
+
OutputObjectDefinition,
|
|
22
23
|
OutputSpec,
|
|
23
24
|
OutputTypeOrFunction,
|
|
24
25
|
PromptedOutput,
|
|
@@ -581,14 +582,6 @@ class ToolOrTextOutputSchema(ToolOutputSchema[OutputDataT], PlainTextOutputSchem
|
|
|
581
582
|
return 'tool_or_text'
|
|
582
583
|
|
|
583
584
|
|
|
584
|
-
@dataclass
|
|
585
|
-
class OutputObjectDefinition:
|
|
586
|
-
json_schema: ObjectJsonSchema
|
|
587
|
-
name: str | None = None
|
|
588
|
-
description: str | None = None
|
|
589
|
-
strict: bool | None = None
|
|
590
|
-
|
|
591
|
-
|
|
592
585
|
@dataclass(init=False)
|
|
593
586
|
class BaseOutputProcessor(ABC, Generic[OutputDataT]):
|
|
594
587
|
@abstractmethod
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations as _annotations
|
|
2
2
|
|
|
3
|
-
from pydantic_ai
|
|
3
|
+
from pydantic_ai import TextPart, ThinkingPart
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
def split_content_into_text_and_thinking(content: str, thinking_tags: tuple[str, str]) -> list[ThinkingPart | TextPart]:
|
|
@@ -6,7 +6,7 @@ import inspect
|
|
|
6
6
|
import re
|
|
7
7
|
import time
|
|
8
8
|
import uuid
|
|
9
|
-
from collections.abc import AsyncIterable, AsyncIterator, Awaitable, Callable, Iterator
|
|
9
|
+
from collections.abc import AsyncIterable, AsyncIterator, Awaitable, Callable, Iterable, Iterator
|
|
10
10
|
from contextlib import asynccontextmanager, suppress
|
|
11
11
|
from dataclasses import dataclass, fields, is_dataclass
|
|
12
12
|
from datetime import datetime, timezone
|
|
@@ -70,16 +70,33 @@ def check_object_json_schema(schema: JsonSchemaValue) -> ObjectJsonSchema:
|
|
|
70
70
|
|
|
71
71
|
if schema.get('type') == 'object':
|
|
72
72
|
return schema
|
|
73
|
-
elif schema.get('$ref')
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
elif ref := schema.get('$ref'):
|
|
74
|
+
prefix = '#/$defs/'
|
|
75
|
+
# Return the referenced schema unless it contains additional nested references.
|
|
76
|
+
if (
|
|
77
|
+
ref.startswith(prefix)
|
|
78
|
+
and (resolved := schema.get('$defs', {}).get(ref[len(prefix) :]))
|
|
79
|
+
and resolved.get('type') == 'object'
|
|
80
|
+
and not _contains_ref(resolved)
|
|
81
|
+
):
|
|
82
|
+
return resolved
|
|
83
|
+
return schema
|
|
79
84
|
else:
|
|
80
85
|
raise UserError('Schema must be an object')
|
|
81
86
|
|
|
82
87
|
|
|
88
|
+
def _contains_ref(obj: JsonSchemaValue | list[JsonSchemaValue]) -> bool:
|
|
89
|
+
"""Recursively check if an object contains any $ref keys."""
|
|
90
|
+
items: Iterable[JsonSchemaValue]
|
|
91
|
+
if isinstance(obj, dict):
|
|
92
|
+
if '$ref' in obj:
|
|
93
|
+
return True
|
|
94
|
+
items = obj.values()
|
|
95
|
+
else:
|
|
96
|
+
items = obj
|
|
97
|
+
return any(isinstance(item, dict | list) and _contains_ref(item) for item in items) # pyright: ignore[reportUnknownArgumentType]
|
|
98
|
+
|
|
99
|
+
|
|
83
100
|
T = TypeVar('T')
|
|
84
101
|
|
|
85
102
|
|
|
@@ -1206,8 +1206,7 @@ class Agent(AbstractAgent[AgentDepsT, OutputDataT]):
|
|
|
1206
1206
|
|
|
1207
1207
|
Example:
|
|
1208
1208
|
```python
|
|
1209
|
-
from pydantic_ai import Agent, RunContext
|
|
1210
|
-
from pydantic_ai.toolsets import AbstractToolset, FunctionToolset
|
|
1209
|
+
from pydantic_ai import AbstractToolset, Agent, FunctionToolset, RunContext
|
|
1211
1210
|
|
|
1212
1211
|
agent = Agent('test', deps_type=str)
|
|
1213
1212
|
|
|
@@ -6,7 +6,14 @@ from typing import Literal
|
|
|
6
6
|
|
|
7
7
|
from typing_extensions import TypedDict
|
|
8
8
|
|
|
9
|
-
__all__ = (
|
|
9
|
+
__all__ = (
|
|
10
|
+
'AbstractBuiltinTool',
|
|
11
|
+
'WebSearchTool',
|
|
12
|
+
'WebSearchUserLocation',
|
|
13
|
+
'CodeExecutionTool',
|
|
14
|
+
'UrlContextTool',
|
|
15
|
+
'MemoryTool',
|
|
16
|
+
)
|
|
10
17
|
|
|
11
18
|
|
|
12
19
|
@dataclass(kw_only=True)
|
|
@@ -133,3 +140,15 @@ class UrlContextTool(AbstractBuiltinTool):
|
|
|
133
140
|
|
|
134
141
|
kind: str = 'url_context'
|
|
135
142
|
"""The kind of tool."""
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class MemoryTool(AbstractBuiltinTool):
|
|
146
|
+
"""A builtin tool that allows your agent to use memory.
|
|
147
|
+
|
|
148
|
+
Supported by:
|
|
149
|
+
|
|
150
|
+
* Anthropic
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
kind: str = 'memory'
|
|
154
|
+
"""The kind of tool."""
|
|
@@ -4,7 +4,7 @@ from dataclasses import KW_ONLY, dataclass
|
|
|
4
4
|
import anyio
|
|
5
5
|
import anyio.to_thread
|
|
6
6
|
from pydantic import TypeAdapter
|
|
7
|
-
from typing_extensions import TypedDict
|
|
7
|
+
from typing_extensions import Any, TypedDict
|
|
8
8
|
|
|
9
9
|
from pydantic_ai.tools import Tool
|
|
10
10
|
|
|
@@ -69,7 +69,7 @@ def duckduckgo_search_tool(duckduckgo_client: DDGS | None = None, max_results: i
|
|
|
69
69
|
duckduckgo_client: The DuckDuckGo search client.
|
|
70
70
|
max_results: The maximum number of results. If None, returns results only from the first response.
|
|
71
71
|
"""
|
|
72
|
-
return Tool(
|
|
72
|
+
return Tool[Any](
|
|
73
73
|
DuckDuckGoSearchTool(client=duckduckgo_client or DDGS(), max_results=max_results).__call__,
|
|
74
74
|
name='duckduckgo_search',
|
|
75
75
|
description='Searches DuckDuckGo for the given query and returns the results.',
|
|
@@ -2,7 +2,7 @@ from dataclasses import dataclass
|
|
|
2
2
|
from typing import Literal
|
|
3
3
|
|
|
4
4
|
from pydantic import TypeAdapter
|
|
5
|
-
from typing_extensions import TypedDict
|
|
5
|
+
from typing_extensions import Any, TypedDict
|
|
6
6
|
|
|
7
7
|
from pydantic_ai.tools import Tool
|
|
8
8
|
|
|
@@ -74,7 +74,7 @@ def tavily_search_tool(api_key: str):
|
|
|
74
74
|
|
|
75
75
|
You can get one by signing up at [https://app.tavily.com/home](https://app.tavily.com/home).
|
|
76
76
|
"""
|
|
77
|
-
return Tool(
|
|
77
|
+
return Tool[Any](
|
|
78
78
|
TavilySearchTool(client=AsyncTavilyClient(api_key)).__call__,
|
|
79
79
|
name='tavily_search',
|
|
80
80
|
description='Searches Tavily for the given query and returns the results.',
|
|
@@ -44,8 +44,8 @@ async def model_request(
|
|
|
44
44
|
"""Make a non-streamed request to a model.
|
|
45
45
|
|
|
46
46
|
```py title="model_request_example.py"
|
|
47
|
+
from pydantic_ai import ModelRequest
|
|
47
48
|
from pydantic_ai.direct import model_request
|
|
48
|
-
from pydantic_ai.messages import ModelRequest
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
async def main():
|
|
@@ -99,8 +99,8 @@ def model_request_sync(
|
|
|
99
99
|
`loop.run_until_complete(...)`. You therefore can't use this method inside async code or if there's an active event loop.
|
|
100
100
|
|
|
101
101
|
```py title="model_request_sync_example.py"
|
|
102
|
+
from pydantic_ai import ModelRequest
|
|
102
103
|
from pydantic_ai.direct import model_request_sync
|
|
103
|
-
from pydantic_ai.messages import ModelRequest
|
|
104
104
|
|
|
105
105
|
model_response = model_request_sync(
|
|
106
106
|
'anthropic:claude-3-5-haiku-latest',
|
|
@@ -153,8 +153,8 @@ def model_request_stream(
|
|
|
153
153
|
|
|
154
154
|
```py {title="model_request_stream_example.py"}
|
|
155
155
|
|
|
156
|
+
from pydantic_ai import ModelRequest
|
|
156
157
|
from pydantic_ai.direct import model_request_stream
|
|
157
|
-
from pydantic_ai.messages import ModelRequest
|
|
158
158
|
|
|
159
159
|
|
|
160
160
|
async def main():
|
|
@@ -212,8 +212,8 @@ def model_request_stream_sync(
|
|
|
212
212
|
|
|
213
213
|
```py {title="model_request_stream_sync_example.py"}
|
|
214
214
|
|
|
215
|
+
from pydantic_ai import ModelRequest
|
|
215
216
|
from pydantic_ai.direct import model_request_stream_sync
|
|
216
|
-
from pydantic_ai.messages import ModelRequest
|
|
217
217
|
|
|
218
218
|
messages = [ModelRequest.user_text_prompt('Who was Albert Einstein?')]
|
|
219
219
|
with model_request_stream_sync('openai:gpt-4.1-mini', messages) as stream:
|
|
@@ -8,6 +8,7 @@ from dbos import DBOS, DBOSConfiguredInstance
|
|
|
8
8
|
from typing_extensions import Never
|
|
9
9
|
|
|
10
10
|
from pydantic_ai import (
|
|
11
|
+
AbstractToolset,
|
|
11
12
|
_utils,
|
|
12
13
|
messages as _messages,
|
|
13
14
|
models,
|
|
@@ -26,7 +27,6 @@ from pydantic_ai.tools import (
|
|
|
26
27
|
Tool,
|
|
27
28
|
ToolFuncEither,
|
|
28
29
|
)
|
|
29
|
-
from pydantic_ai.toolsets import AbstractToolset
|
|
30
30
|
|
|
31
31
|
from ._model import DBOSModel
|
|
32
32
|
from ._utils import StepConfig
|
{pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/dbos/_mcp_server.py
RENAMED
|
@@ -7,9 +7,8 @@ from typing import TYPE_CHECKING, Any
|
|
|
7
7
|
from dbos import DBOS
|
|
8
8
|
from typing_extensions import Self
|
|
9
9
|
|
|
10
|
+
from pydantic_ai import AbstractToolset, ToolsetTool, WrapperToolset
|
|
10
11
|
from pydantic_ai.tools import AgentDepsT, RunContext
|
|
11
|
-
from pydantic_ai.toolsets.abstract import AbstractToolset, ToolsetTool
|
|
12
|
-
from pydantic_ai.toolsets.wrapper import WrapperToolset
|
|
13
12
|
|
|
14
13
|
from ._utils import StepConfig
|
|
15
14
|
|
|
@@ -7,12 +7,12 @@ from typing import Any
|
|
|
7
7
|
|
|
8
8
|
from dbos import DBOS
|
|
9
9
|
|
|
10
|
-
from pydantic_ai
|
|
11
|
-
from pydantic_ai.messages import (
|
|
10
|
+
from pydantic_ai import (
|
|
12
11
|
ModelMessage,
|
|
13
12
|
ModelResponse,
|
|
14
13
|
ModelResponseStreamEvent,
|
|
15
14
|
)
|
|
15
|
+
from pydantic_ai.agent import EventStreamHandler
|
|
16
16
|
from pydantic_ai.models import Model, ModelRequestParameters, StreamedResponse
|
|
17
17
|
from pydantic_ai.models.wrapper import WrapperModel
|
|
18
18
|
from pydantic_ai.settings import ModelSettings
|
{pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_agent.py
RENAMED
|
@@ -16,6 +16,7 @@ from temporalio.workflow import ActivityConfig
|
|
|
16
16
|
from typing_extensions import Never
|
|
17
17
|
|
|
18
18
|
from pydantic_ai import (
|
|
19
|
+
AbstractToolset,
|
|
19
20
|
_utils,
|
|
20
21
|
messages as _messages,
|
|
21
22
|
models,
|
|
@@ -34,7 +35,6 @@ from pydantic_ai.tools import (
|
|
|
34
35
|
Tool,
|
|
35
36
|
ToolFuncEither,
|
|
36
37
|
)
|
|
37
|
-
from pydantic_ai.toolsets import AbstractToolset
|
|
38
38
|
|
|
39
39
|
from ._model import TemporalModel
|
|
40
40
|
from ._run_context import TemporalRunContext
|
|
@@ -8,9 +8,9 @@ from pydantic import ConfigDict, Discriminator, with_config
|
|
|
8
8
|
from temporalio import activity, workflow
|
|
9
9
|
from temporalio.workflow import ActivityConfig
|
|
10
10
|
|
|
11
|
+
from pydantic_ai import FunctionToolset, ToolsetTool
|
|
11
12
|
from pydantic_ai.exceptions import ApprovalRequired, CallDeferred, ModelRetry, UserError
|
|
12
13
|
from pydantic_ai.tools import AgentDepsT, RunContext
|
|
13
|
-
from pydantic_ai.toolsets import FunctionToolset, ToolsetTool
|
|
14
14
|
from pydantic_ai.toolsets.function import FunctionToolsetTool
|
|
15
15
|
|
|
16
16
|
from ._run_context import TemporalRunContext
|
{pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_mcp_server.py
RENAMED
|
@@ -9,10 +9,10 @@ from temporalio import activity, workflow
|
|
|
9
9
|
from temporalio.workflow import ActivityConfig
|
|
10
10
|
from typing_extensions import Self
|
|
11
11
|
|
|
12
|
+
from pydantic_ai import ToolsetTool
|
|
12
13
|
from pydantic_ai.exceptions import UserError
|
|
13
14
|
from pydantic_ai.mcp import MCPServer, ToolResult
|
|
14
15
|
from pydantic_ai.tools import AgentDepsT, RunContext, ToolDefinition
|
|
15
|
-
from pydantic_ai.toolsets.abstract import ToolsetTool
|
|
16
16
|
|
|
17
17
|
from ._run_context import TemporalRunContext
|
|
18
18
|
from ._toolset import TemporalWrapperToolset
|
{pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_model.py
RENAMED
|
@@ -10,13 +10,13 @@ from pydantic import ConfigDict, with_config
|
|
|
10
10
|
from temporalio import activity, workflow
|
|
11
11
|
from temporalio.workflow import ActivityConfig
|
|
12
12
|
|
|
13
|
-
from pydantic_ai
|
|
14
|
-
from pydantic_ai.exceptions import UserError
|
|
15
|
-
from pydantic_ai.messages import (
|
|
13
|
+
from pydantic_ai import (
|
|
16
14
|
ModelMessage,
|
|
17
15
|
ModelResponse,
|
|
18
16
|
ModelResponseStreamEvent,
|
|
19
17
|
)
|
|
18
|
+
from pydantic_ai.agent import EventStreamHandler
|
|
19
|
+
from pydantic_ai.exceptions import UserError
|
|
20
20
|
from pydantic_ai.models import Model, ModelRequestParameters, StreamedResponse
|
|
21
21
|
from pydantic_ai.models.wrapper import WrapperModel
|
|
22
22
|
from pydantic_ai.settings import ModelSettings
|
{pydantic_ai_slim-1.0.10 → pydantic_ai_slim-1.0.12}/pydantic_ai/durable_exec/temporal/_toolset.py
RENAMED
|
@@ -6,10 +6,8 @@ from typing import Any, Literal
|
|
|
6
6
|
|
|
7
7
|
from temporalio.workflow import ActivityConfig
|
|
8
8
|
|
|
9
|
+
from pydantic_ai import AbstractToolset, FunctionToolset, WrapperToolset
|
|
9
10
|
from pydantic_ai.tools import AgentDepsT
|
|
10
|
-
from pydantic_ai.toolsets.abstract import AbstractToolset
|
|
11
|
-
from pydantic_ai.toolsets.function import FunctionToolset
|
|
12
|
-
from pydantic_ai.toolsets.wrapper import WrapperToolset
|
|
13
11
|
|
|
14
12
|
from ._run_context import TemporalRunContext
|
|
15
13
|
|