pydantic-ai-slim 0.8.1__py3-none-any.whl → 1.0.0b1__py3-none-any.whl
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/__init__.py +28 -2
- pydantic_ai/_agent_graph.py +310 -140
- pydantic_ai/_function_schema.py +5 -5
- pydantic_ai/_griffe.py +2 -1
- pydantic_ai/_otel_messages.py +2 -2
- pydantic_ai/_output.py +31 -35
- pydantic_ai/_parts_manager.py +4 -4
- pydantic_ai/_run_context.py +3 -1
- pydantic_ai/_system_prompt.py +2 -2
- pydantic_ai/_tool_manager.py +3 -22
- pydantic_ai/_utils.py +14 -26
- pydantic_ai/ag_ui.py +7 -8
- pydantic_ai/agent/__init__.py +70 -9
- pydantic_ai/agent/abstract.py +35 -4
- pydantic_ai/agent/wrapper.py +6 -0
- pydantic_ai/builtin_tools.py +2 -2
- pydantic_ai/common_tools/duckduckgo.py +4 -2
- pydantic_ai/durable_exec/temporal/__init__.py +4 -2
- pydantic_ai/durable_exec/temporal/_agent.py +23 -2
- pydantic_ai/durable_exec/temporal/_function_toolset.py +53 -6
- pydantic_ai/durable_exec/temporal/_logfire.py +1 -1
- pydantic_ai/durable_exec/temporal/_mcp_server.py +2 -1
- pydantic_ai/durable_exec/temporal/_model.py +2 -2
- pydantic_ai/durable_exec/temporal/_run_context.py +2 -1
- pydantic_ai/durable_exec/temporal/_toolset.py +2 -1
- pydantic_ai/exceptions.py +45 -2
- pydantic_ai/format_prompt.py +2 -2
- pydantic_ai/mcp.py +2 -2
- pydantic_ai/messages.py +73 -25
- pydantic_ai/models/__init__.py +5 -4
- pydantic_ai/models/anthropic.py +5 -5
- pydantic_ai/models/bedrock.py +58 -56
- pydantic_ai/models/cohere.py +3 -3
- pydantic_ai/models/fallback.py +2 -2
- pydantic_ai/models/function.py +25 -23
- pydantic_ai/models/gemini.py +9 -12
- pydantic_ai/models/google.py +3 -3
- pydantic_ai/models/groq.py +4 -4
- pydantic_ai/models/huggingface.py +4 -4
- pydantic_ai/models/instrumented.py +30 -16
- pydantic_ai/models/mcp_sampling.py +3 -1
- pydantic_ai/models/mistral.py +6 -6
- pydantic_ai/models/openai.py +18 -27
- pydantic_ai/models/test.py +24 -4
- pydantic_ai/output.py +27 -32
- pydantic_ai/profiles/__init__.py +3 -3
- pydantic_ai/profiles/groq.py +1 -1
- pydantic_ai/profiles/openai.py +25 -4
- pydantic_ai/providers/anthropic.py +2 -3
- pydantic_ai/providers/bedrock.py +3 -2
- pydantic_ai/result.py +144 -41
- pydantic_ai/retries.py +10 -29
- pydantic_ai/run.py +12 -5
- pydantic_ai/tools.py +126 -22
- pydantic_ai/toolsets/__init__.py +4 -1
- pydantic_ai/toolsets/_dynamic.py +4 -4
- pydantic_ai/toolsets/abstract.py +18 -2
- pydantic_ai/toolsets/approval_required.py +32 -0
- pydantic_ai/toolsets/combined.py +7 -12
- pydantic_ai/toolsets/{deferred.py → external.py} +11 -5
- pydantic_ai/toolsets/filtered.py +1 -1
- pydantic_ai/toolsets/function.py +13 -4
- pydantic_ai/toolsets/wrapper.py +2 -1
- pydantic_ai/usage.py +7 -5
- {pydantic_ai_slim-0.8.1.dist-info → pydantic_ai_slim-1.0.0b1.dist-info}/METADATA +5 -6
- pydantic_ai_slim-1.0.0b1.dist-info/RECORD +120 -0
- pydantic_ai_slim-0.8.1.dist-info/RECORD +0 -119
- {pydantic_ai_slim-0.8.1.dist-info → pydantic_ai_slim-1.0.0b1.dist-info}/WHEEL +0 -0
- {pydantic_ai_slim-0.8.1.dist-info → pydantic_ai_slim-1.0.0b1.dist-info}/entry_points.txt +0 -0
- {pydantic_ai_slim-0.8.1.dist-info → pydantic_ai_slim-1.0.0b1.dist-info}/licenses/LICENSE +0 -0
pydantic_ai/__init__.py
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
from importlib.metadata import version as _metadata_version
|
|
2
2
|
|
|
3
|
-
from .agent import
|
|
3
|
+
from .agent import (
|
|
4
|
+
Agent,
|
|
5
|
+
CallToolsNode,
|
|
6
|
+
EndStrategy,
|
|
7
|
+
InstrumentationSettings,
|
|
8
|
+
ModelRequestNode,
|
|
9
|
+
UserPromptNode,
|
|
10
|
+
capture_run_messages,
|
|
11
|
+
)
|
|
4
12
|
from .builtin_tools import CodeExecutionTool, UrlContextTool, WebSearchTool, WebSearchUserLocation
|
|
5
13
|
from .exceptions import (
|
|
6
14
|
AgentRunError,
|
|
15
|
+
ApprovalRequired,
|
|
16
|
+
CallDeferred,
|
|
7
17
|
FallbackExceptionGroup,
|
|
8
18
|
ModelHTTPError,
|
|
9
19
|
ModelRetry,
|
|
@@ -14,7 +24,9 @@ from .exceptions import (
|
|
|
14
24
|
from .format_prompt import format_as_xml
|
|
15
25
|
from .messages import AudioUrl, BinaryContent, DocumentUrl, ImageUrl, VideoUrl
|
|
16
26
|
from .output import NativeOutput, PromptedOutput, StructuredDict, TextOutput, ToolOutput
|
|
17
|
-
from .
|
|
27
|
+
from .settings import ModelSettings
|
|
28
|
+
from .tools import DeferredToolRequests, DeferredToolResults, RunContext, Tool, ToolApproved, ToolDefinition, ToolDenied
|
|
29
|
+
from .usage import RequestUsage, RunUsage, UsageLimits
|
|
18
30
|
|
|
19
31
|
__all__ = (
|
|
20
32
|
'__version__',
|
|
@@ -25,8 +37,11 @@ __all__ = (
|
|
|
25
37
|
'ModelRequestNode',
|
|
26
38
|
'UserPromptNode',
|
|
27
39
|
'capture_run_messages',
|
|
40
|
+
'InstrumentationSettings',
|
|
28
41
|
# exceptions
|
|
29
42
|
'AgentRunError',
|
|
43
|
+
'CallDeferred',
|
|
44
|
+
'ApprovalRequired',
|
|
30
45
|
'ModelRetry',
|
|
31
46
|
'ModelHTTPError',
|
|
32
47
|
'FallbackExceptionGroup',
|
|
@@ -41,7 +56,12 @@ __all__ = (
|
|
|
41
56
|
'BinaryContent',
|
|
42
57
|
# tools
|
|
43
58
|
'Tool',
|
|
59
|
+
'ToolDefinition',
|
|
44
60
|
'RunContext',
|
|
61
|
+
'DeferredToolRequests',
|
|
62
|
+
'DeferredToolResults',
|
|
63
|
+
'ToolApproved',
|
|
64
|
+
'ToolDenied',
|
|
45
65
|
# builtin_tools
|
|
46
66
|
'WebSearchTool',
|
|
47
67
|
'WebSearchUserLocation',
|
|
@@ -55,5 +75,11 @@ __all__ = (
|
|
|
55
75
|
'StructuredDict',
|
|
56
76
|
# format_prompt
|
|
57
77
|
'format_as_xml',
|
|
78
|
+
# settings
|
|
79
|
+
'ModelSettings',
|
|
80
|
+
# usage
|
|
81
|
+
'RunUsage',
|
|
82
|
+
'RequestUsage',
|
|
83
|
+
'UsageLimits',
|
|
58
84
|
)
|
|
59
85
|
__version__ = _metadata_version('pydantic_ai_slim')
|