pydantic-ai-slim 0.7.3__py3-none-any.whl → 0.7.5__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 +2 -1
- pydantic_ai/_otel_messages.py +67 -0
- pydantic_ai/builtin_tools.py +10 -1
- pydantic_ai/durable_exec/temporal/_model.py +4 -0
- pydantic_ai/messages.py +109 -18
- pydantic_ai/models/__init__.py +7 -0
- pydantic_ai/models/anthropic.py +18 -6
- pydantic_ai/models/bedrock.py +15 -9
- pydantic_ai/models/cohere.py +3 -1
- pydantic_ai/models/function.py +5 -0
- pydantic_ai/models/gemini.py +8 -1
- pydantic_ai/models/google.py +37 -13
- pydantic_ai/models/groq.py +8 -0
- pydantic_ai/models/huggingface.py +8 -0
- pydantic_ai/models/instrumented.py +103 -42
- pydantic_ai/models/mistral.py +8 -0
- pydantic_ai/models/openai.py +18 -0
- pydantic_ai/models/test.py +7 -0
- pydantic_ai/providers/anthropic.py +11 -8
- pydantic_ai/tools.py +5 -2
- pydantic_ai/usage.py +1 -1
- {pydantic_ai_slim-0.7.3.dist-info → pydantic_ai_slim-0.7.5.dist-info}/METADATA +4 -4
- {pydantic_ai_slim-0.7.3.dist-info → pydantic_ai_slim-0.7.5.dist-info}/RECORD +26 -25
- {pydantic_ai_slim-0.7.3.dist-info → pydantic_ai_slim-0.7.5.dist-info}/WHEEL +0 -0
- {pydantic_ai_slim-0.7.3.dist-info → pydantic_ai_slim-0.7.5.dist-info}/entry_points.txt +0 -0
- {pydantic_ai_slim-0.7.3.dist-info → pydantic_ai_slim-0.7.5.dist-info}/licenses/LICENSE +0 -0
pydantic_ai/tools.py
CHANGED
|
@@ -266,6 +266,7 @@ class Tool(Generic[AgentDepsT]):
|
|
|
266
266
|
name: str,
|
|
267
267
|
description: str | None,
|
|
268
268
|
json_schema: JsonSchemaValue,
|
|
269
|
+
takes_ctx: bool = False,
|
|
269
270
|
) -> Self:
|
|
270
271
|
"""Creates a Pydantic tool from a function and a JSON schema.
|
|
271
272
|
|
|
@@ -277,6 +278,8 @@ class Tool(Generic[AgentDepsT]):
|
|
|
277
278
|
description: Used to tell the model how/when/why to use the tool.
|
|
278
279
|
You can provide few-shot examples as a part of the description.
|
|
279
280
|
json_schema: The schema for the function arguments
|
|
281
|
+
takes_ctx: An optional boolean parameter indicating whether the function
|
|
282
|
+
accepts the context object as an argument.
|
|
280
283
|
|
|
281
284
|
Returns:
|
|
282
285
|
A Pydantic tool that calls the function
|
|
@@ -286,13 +289,13 @@ class Tool(Generic[AgentDepsT]):
|
|
|
286
289
|
description=description,
|
|
287
290
|
validator=SchemaValidator(schema=core_schema.any_schema()),
|
|
288
291
|
json_schema=json_schema,
|
|
289
|
-
takes_ctx=
|
|
292
|
+
takes_ctx=takes_ctx,
|
|
290
293
|
is_async=_utils.is_async_callable(function),
|
|
291
294
|
)
|
|
292
295
|
|
|
293
296
|
return cls(
|
|
294
297
|
function,
|
|
295
|
-
takes_ctx=
|
|
298
|
+
takes_ctx=takes_ctx,
|
|
296
299
|
name=name,
|
|
297
300
|
description=description,
|
|
298
301
|
function_schema=function_schema,
|
pydantic_ai/usage.py
CHANGED
|
@@ -292,7 +292,7 @@ class UsageLimits:
|
|
|
292
292
|
|
|
293
293
|
total_tokens = usage.total_tokens
|
|
294
294
|
if self.total_tokens_limit is not None and total_tokens > self.total_tokens_limit:
|
|
295
|
-
raise UsageLimitExceeded(
|
|
295
|
+
raise UsageLimitExceeded( # pragma: lax no cover
|
|
296
296
|
f'The next request would exceed the total_tokens_limit of {self.total_tokens_limit} ({total_tokens=})'
|
|
297
297
|
)
|
|
298
298
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pydantic-ai-slim
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.5
|
|
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
|
|
@@ -35,7 +35,7 @@ Requires-Dist: genai-prices>=0.0.22
|
|
|
35
35
|
Requires-Dist: griffe>=1.3.2
|
|
36
36
|
Requires-Dist: httpx>=0.27
|
|
37
37
|
Requires-Dist: opentelemetry-api>=1.28.0
|
|
38
|
-
Requires-Dist: pydantic-graph==0.7.
|
|
38
|
+
Requires-Dist: pydantic-graph==0.7.5
|
|
39
39
|
Requires-Dist: pydantic>=2.10
|
|
40
40
|
Requires-Dist: typing-inspection>=0.4.0
|
|
41
41
|
Provides-Extra: a2a
|
|
@@ -57,9 +57,9 @@ Requires-Dist: cohere>=5.16.0; (platform_system != 'Emscripten') and extra == 'c
|
|
|
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==0.7.
|
|
60
|
+
Requires-Dist: pydantic-evals==0.7.5; extra == 'evals'
|
|
61
61
|
Provides-Extra: google
|
|
62
|
-
Requires-Dist: google-genai>=1.
|
|
62
|
+
Requires-Dist: google-genai>=1.31.0; extra == 'google'
|
|
63
63
|
Provides-Extra: groq
|
|
64
64
|
Requires-Dist: groq>=0.25.0; extra == 'groq'
|
|
65
65
|
Provides-Extra: huggingface
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
pydantic_ai/__init__.py,sha256=
|
|
1
|
+
pydantic_ai/__init__.py,sha256=i_AteC7yah1Z55PO7JNa3po2-mC10RoefDG-N6Vp4CQ,1516
|
|
2
2
|
pydantic_ai/__main__.py,sha256=Q_zJU15DUA01YtlJ2mnaLCoId2YmgmreVEERGuQT-Y0,132
|
|
3
3
|
pydantic_ai/_a2a.py,sha256=wux52DmJQceLJwF71qxb0Uqupk3aS61m005-NmuWZIw,12164
|
|
4
4
|
pydantic_ai/_agent_graph.py,sha256=W6bdFC_LtROBkU7ZpWqWL-sTSKD17tYyeBI9nWzVL5k,38484
|
|
@@ -6,6 +6,7 @@ pydantic_ai/_cli.py,sha256=YNqV2Kb3KYpof0lD4wwnULM2sCxzsvBzsh-oPd6lJN8,13959
|
|
|
6
6
|
pydantic_ai/_function_schema.py,sha256=YFHxb6bKfhgeY6rNdbuYXgndGCDanveUx2258xkSNlQ,11233
|
|
7
7
|
pydantic_ai/_griffe.py,sha256=Ugft16ZHw9CN_6-lW0Svn6jESK9zHXO_x4utkGBkbBI,5253
|
|
8
8
|
pydantic_ai/_mcp.py,sha256=PuvwnlLjv7YYOa9AZJCrklevBug99zGMhwJCBGG7BHQ,5626
|
|
9
|
+
pydantic_ai/_otel_messages.py,sha256=C_t8Jj0tlbYPGS_Wuf5eSw_7n3SwDsFfLQjLl9hM_bk,1480
|
|
9
10
|
pydantic_ai/_output.py,sha256=6Vxlw8F9nRWCkjy4qvFF8tmDi2xZn7Dq72T6s4C5kAM,37640
|
|
10
11
|
pydantic_ai/_parts_manager.py,sha256=zrra5yDpAX8cFB_eK0btAp9d6NAR979V1Rmepm83l1w,17980
|
|
11
12
|
pydantic_ai/_run_context.py,sha256=uSjR0a9QJ7KifqJsu7buGpK4wqexO7ldZMzWsBOboDI,1697
|
|
@@ -14,20 +15,20 @@ pydantic_ai/_thinking_part.py,sha256=x80-Vkon16GOyq3W6f2qzafTVPC5dCgF7QD3k8ZMmYU
|
|
|
14
15
|
pydantic_ai/_tool_manager.py,sha256=WPMXgHBzyn7UgRKIuqU-oV2GpsAOW0nF2RsxPCKOp7U,9655
|
|
15
16
|
pydantic_ai/_utils.py,sha256=Ge9rtu8NJvsfSFjx1MduITPr0-9b_I0emDFSpwJbYes,16372
|
|
16
17
|
pydantic_ai/ag_ui.py,sha256=bd-RJYFFmcw2xkAWj-7N0ZLRMa1dam3LEhlgoNo1l9I,26475
|
|
17
|
-
pydantic_ai/builtin_tools.py,sha256=
|
|
18
|
+
pydantic_ai/builtin_tools.py,sha256=Fr9PF5RDdi5xQzKj7VJ8iDulbNgvF0yBdCC8E6F38Vo,3194
|
|
18
19
|
pydantic_ai/direct.py,sha256=ym1Lb7oCPDU2eMmN8LXzN7Dp_IUJIPmlyKgmxxBUxsc,14905
|
|
19
20
|
pydantic_ai/exceptions.py,sha256=vHRH_b6JpMi5p5EGhz2O4FSeKGJv3WMD291Y1FjHYFc,3528
|
|
20
21
|
pydantic_ai/format_prompt.py,sha256=Or-Ytq55RQb1UJqy2HKIyPpZ-knWXfdDP3Z6tNc6Orw,4244
|
|
21
22
|
pydantic_ai/mcp.py,sha256=n9_ECHmFE-eOZmb1bDh94oy81caefdtSGo1oH2KKWMo,31162
|
|
22
|
-
pydantic_ai/messages.py,sha256=
|
|
23
|
+
pydantic_ai/messages.py,sha256=G65-bCxQt3EpfD-uAFs-Pz8HXFeIqe2V-kvOeXRsaOg,50131
|
|
23
24
|
pydantic_ai/output.py,sha256=54Cwd1RruXlA5hucZ1h-SxFrzKHJuLvYvLtH9iyg2GI,11988
|
|
24
25
|
pydantic_ai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
26
|
pydantic_ai/result.py,sha256=gUVJIyoM1FewRFLj7ezuXr7M2RSaQL4AytoIpBMmDy8,19800
|
|
26
27
|
pydantic_ai/retries.py,sha256=Xkj-gZAd3wc12CVsIErVYx2EIdIwD5yJOL4Ou6jDQ2s,10498
|
|
27
28
|
pydantic_ai/run.py,sha256=acyyTDH8qP1W-gbUA8TBBcOqte-7ICyoelJRjO_ojeo,14879
|
|
28
29
|
pydantic_ai/settings.py,sha256=yuUZ7-GkdPB-Gbx71kSdh8dSr6gwM9gEwk84qNxPO_I,3552
|
|
29
|
-
pydantic_ai/tools.py,sha256=
|
|
30
|
-
pydantic_ai/usage.py,sha256=
|
|
30
|
+
pydantic_ai/tools.py,sha256=HzwxH7H-TVCRmGF8PnKIQe1zlElorDFD2o_qrWrmyDc,15006
|
|
31
|
+
pydantic_ai/usage.py,sha256=7A9GkTo9SohQtd54OzL3sl3oix4s634kDEdWsHI4wlA,12150
|
|
31
32
|
pydantic_ai/agent/__init__.py,sha256=6qe2t2TRr4yjwClHYaVRCSWFnDD8_7_0LhSfqF1L1ac,59255
|
|
32
33
|
pydantic_ai/agent/abstract.py,sha256=2B00V-SmKlFkrkVW2KQ4e0K_glr9cQL6Llq2OYLqlgg,42000
|
|
33
34
|
pydantic_ai/agent/wrapper.py,sha256=sE_9rA1PNF5v0qAMhRYw0W8bIhLT4RP17S3TSLz0k5w,9084
|
|
@@ -40,27 +41,27 @@ pydantic_ai/durable_exec/temporal/_agent.py,sha256=H1oHoZC9wOuAN79LG7Qb3DNtK2XFC
|
|
|
40
41
|
pydantic_ai/durable_exec/temporal/_function_toolset.py,sha256=qKTs7T6YcJ2LBOvrlYBRUHd9zn86TuUaY0Qw5TPGSmE,3848
|
|
41
42
|
pydantic_ai/durable_exec/temporal/_logfire.py,sha256=_dsvVIdpYJEUyoFUIDYQjCO6TjTITqvlJHwNy_Fi2cw,1866
|
|
42
43
|
pydantic_ai/durable_exec/temporal/_mcp_server.py,sha256=J7CC4gRDhM4uQo3_kNKV7e4uiWC0He0AgS7bdq9Pt4o,6005
|
|
43
|
-
pydantic_ai/durable_exec/temporal/_model.py,sha256=
|
|
44
|
+
pydantic_ai/durable_exec/temporal/_model.py,sha256=hHanoDWEi6FgSvFJ7HUJaAzE0aEFAj0VZ2sb0wQ-3EY,6765
|
|
44
45
|
pydantic_ai/durable_exec/temporal/_run_context.py,sha256=5NTomzWBAlFcXeVw-4mqa76Rmrc8b3G1bB5ElVsAyCY,2310
|
|
45
46
|
pydantic_ai/durable_exec/temporal/_toolset.py,sha256=XlQx7NGSKR9n-mjNWaTn-i3HW9X4z5fZUAM9DwDTBwY,2865
|
|
46
47
|
pydantic_ai/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
48
|
pydantic_ai/ext/aci.py,sha256=sUllKDNO-LOMurbFgxwRHuzNlBkSa3aVBqXfEm-A_vo,2545
|
|
48
49
|
pydantic_ai/ext/langchain.py,sha256=iLVEZv1kcLkdIHo3us2yfdi0kVqyJ6qTaCt9BoLWm4k,2335
|
|
49
|
-
pydantic_ai/models/__init__.py,sha256=
|
|
50
|
-
pydantic_ai/models/anthropic.py,sha256=
|
|
51
|
-
pydantic_ai/models/bedrock.py,sha256=
|
|
52
|
-
pydantic_ai/models/cohere.py,sha256=
|
|
50
|
+
pydantic_ai/models/__init__.py,sha256=tfMixYa06ByHDBo5A0NFNpMuwr8mXpiVgAp6JBBSYlU,34834
|
|
51
|
+
pydantic_ai/models/anthropic.py,sha256=2Nhu_m_W9EdsbeUe4aAV-Jcdv7hPOG4OuI6DmRjSi2o,30464
|
|
52
|
+
pydantic_ai/models/bedrock.py,sha256=8azpQUM4Z4haDM0kdrkUUcc88Jpu3ff6dybznyRJ20o,30940
|
|
53
|
+
pydantic_ai/models/cohere.py,sha256=WosAOwDbxpeVpIX4swmaxL5XgfcfHwkoekt4UqVeNUQ,13066
|
|
53
54
|
pydantic_ai/models/fallback.py,sha256=ftcYhl0oSOer0vYbLkaf7dfgI_3h0hk7hp07i1Wh9rI,5526
|
|
54
|
-
pydantic_ai/models/function.py,sha256=
|
|
55
|
-
pydantic_ai/models/gemini.py,sha256=
|
|
56
|
-
pydantic_ai/models/google.py,sha256=
|
|
57
|
-
pydantic_ai/models/groq.py,sha256=
|
|
58
|
-
pydantic_ai/models/huggingface.py,sha256=
|
|
59
|
-
pydantic_ai/models/instrumented.py,sha256=
|
|
55
|
+
pydantic_ai/models/function.py,sha256=jSr55QtW1fFxoXNK3EgrmuCcaG0U6uh6q56q8hrI_To,14248
|
|
56
|
+
pydantic_ai/models/gemini.py,sha256=GVSJWhB5Mlkb2uvaq_4BYYRLY59EgP-geCOgrtjbnUI,39369
|
|
57
|
+
pydantic_ai/models/google.py,sha256=rF3x1FpXlmHy53PmNbRuuJJ9ozTnWGGMSo1MGJPw3m8,31408
|
|
58
|
+
pydantic_ai/models/groq.py,sha256=n0V_8ZFeDK7sDk6gc_cAzsaoxjydUq46SzyvKM-gzoM,21202
|
|
59
|
+
pydantic_ai/models/huggingface.py,sha256=7yxCiLHJe_M3S50W6VaRREyHbXn5DTm6558eKZUHiQE,20424
|
|
60
|
+
pydantic_ai/models/instrumented.py,sha256=2RX7aSqtU01NAXt2-0TWeHIDNNmT_KCHd-8qG7bgaN8,19411
|
|
60
61
|
pydantic_ai/models/mcp_sampling.py,sha256=iXIjwTP5Jszn0Iz-5MZiCk_BdUYE7IAxCnC5yIrGIu0,3436
|
|
61
|
-
pydantic_ai/models/mistral.py,sha256=
|
|
62
|
-
pydantic_ai/models/openai.py,sha256=
|
|
63
|
-
pydantic_ai/models/test.py,sha256=
|
|
62
|
+
pydantic_ai/models/mistral.py,sha256=5i_zl_pzo--Dll5OCT7vwCQmvvUt9cI5d19_NVHDRnM,32450
|
|
63
|
+
pydantic_ai/models/openai.py,sha256=Y1OCpLL_QHOHpIs102Bp0aLB93UPbkUF_q6AMBzDi6Q,63497
|
|
64
|
+
pydantic_ai/models/test.py,sha256=7D1l21iI5Kwp9Stdhdd-M8V_1PeofaffETKvB_SHV3Q,19277
|
|
64
65
|
pydantic_ai/models/wrapper.py,sha256=9MeHW7mXPsEK03IKL0rtjeX6QgXyZROOOzLh72GiX2k,2148
|
|
65
66
|
pydantic_ai/profiles/__init__.py,sha256=AdwFrK50_20qJBA_eMXXsV1vdGOvPxLVW82hMQvzXU0,3285
|
|
66
67
|
pydantic_ai/profiles/_json_schema.py,sha256=CthOGmPSjgEZRRglfvg31zyQ9vjHDdacXoFpmba93dE,7206
|
|
@@ -77,7 +78,7 @@ pydantic_ai/profiles/moonshotai.py,sha256=e1RJnbEvazE6aJAqfmYLYGNtwNwg52XQDRDkcL
|
|
|
77
78
|
pydantic_ai/profiles/openai.py,sha256=lSPM1tDiWVxQH45YzD_GjYsnkBzLankRFu5JRGfx81I,8112
|
|
78
79
|
pydantic_ai/profiles/qwen.py,sha256=K4_nJ_oN5NS_9W0Fl-dFgC4emVRTHPXFTtiJ_nycKHo,373
|
|
79
80
|
pydantic_ai/providers/__init__.py,sha256=-jb9Vl4gE7z0katqwLPaKt5UileuPp0Brq0ZueBVJys,4246
|
|
80
|
-
pydantic_ai/providers/anthropic.py,sha256=
|
|
81
|
+
pydantic_ai/providers/anthropic.py,sha256=i9Y7hAHWPTcPUsmRSxtD7QtNrEk5n3uvEtCkYWyipJ4,3200
|
|
81
82
|
pydantic_ai/providers/azure.py,sha256=y77IHGiSQ9Ttx9f4SGMgdpin2Daq6eYyzUdM9ET22RQ,5819
|
|
82
83
|
pydantic_ai/providers/bedrock.py,sha256=8jz77ySKv6CzCktN9YbZb1736gZM0d_btcKvXiZSSHI,5784
|
|
83
84
|
pydantic_ai/providers/cohere.py,sha256=LT6QaLPJBBlFUgYgXQOfKpbM9SXLzorWFxI7jNfOX_4,2892
|
|
@@ -109,8 +110,8 @@ pydantic_ai/toolsets/prefixed.py,sha256=0KwcDkW8OM36ZUsOLVP5h-Nj2tPq78L3_E2c-1Fb
|
|
|
109
110
|
pydantic_ai/toolsets/prepared.py,sha256=Zjfz6S8In6PBVxoKFN9sKPN984zO6t0awB7Lnq5KODw,1431
|
|
110
111
|
pydantic_ai/toolsets/renamed.py,sha256=JuLHpi-hYPiSPlaTpN8WiXLiGsywYK0axi2lW2Qs75k,1637
|
|
111
112
|
pydantic_ai/toolsets/wrapper.py,sha256=mMuMPdko9PJUdcsexlRXbwViSwKKJfv6JE58d8HK3ds,1646
|
|
112
|
-
pydantic_ai_slim-0.7.
|
|
113
|
-
pydantic_ai_slim-0.7.
|
|
114
|
-
pydantic_ai_slim-0.7.
|
|
115
|
-
pydantic_ai_slim-0.7.
|
|
116
|
-
pydantic_ai_slim-0.7.
|
|
113
|
+
pydantic_ai_slim-0.7.5.dist-info/METADATA,sha256=UK0PS8ex-RsTV379rsLtBL9vifFciMESIoTLgjbrbec,4661
|
|
114
|
+
pydantic_ai_slim-0.7.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
115
|
+
pydantic_ai_slim-0.7.5.dist-info/entry_points.txt,sha256=kbKxe2VtDCYS06hsI7P3uZGxcVC08-FPt1rxeiMpIps,50
|
|
116
|
+
pydantic_ai_slim-0.7.5.dist-info/licenses/LICENSE,sha256=vA6Jc482lEyBBuGUfD1pYx-cM7jxvLYOxPidZ30t_PQ,1100
|
|
117
|
+
pydantic_ai_slim-0.7.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|