pydantic-ai-slim 0.2.12__tar.gz → 0.2.13__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-0.2.12 → pydantic_ai_slim-0.2.13}/PKG-INFO +4 -4
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/_output.py +1 -1
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/gemini.py +10 -1
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/google.py +2 -2
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/openai.py +3 -1
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/tools.py +1 -1
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/.gitignore +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/LICENSE +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/README.md +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/__init__.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/__main__.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/_a2a.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/_agent_graph.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/_cli.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/_function_schema.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/_griffe.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/_parts_manager.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/_system_prompt.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/_utils.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/agent.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/common_tools/__init__.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/common_tools/duckduckgo.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/common_tools/tavily.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/direct.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/exceptions.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/format_as_xml.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/format_prompt.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/mcp.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/messages.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/__init__.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/anthropic.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/bedrock.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/cohere.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/fallback.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/function.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/groq.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/instrumented.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/mistral.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/test.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/models/wrapper.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/__init__.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/_json_schema.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/amazon.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/anthropic.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/cohere.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/deepseek.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/google.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/grok.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/meta.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/mistral.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/openai.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/profiles/qwen.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/__init__.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/anthropic.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/azure.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/bedrock.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/cohere.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/deepseek.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/fireworks.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/google.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/google_gla.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/google_vertex.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/grok.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/groq.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/mistral.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/openai.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/openrouter.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/providers/together.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/py.typed +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/result.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/settings.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pydantic_ai/usage.py +0 -0
- {pydantic_ai_slim-0.2.12 → pydantic_ai_slim-0.2.13}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pydantic-ai-slim
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.13
|
|
4
4
|
Summary: Agent Framework / shim to use Pydantic with LLMs, slim package
|
|
5
5
|
Author-email: Samuel Colvin <samuel@pydantic.dev>, Marcelo Trylesinski <marcelotryle@gmail.com>, David Montague <david@pydantic.dev>, Alex Hall <alex@pydantic.dev>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -30,11 +30,11 @@ Requires-Dist: exceptiongroup; python_version < '3.11'
|
|
|
30
30
|
Requires-Dist: griffe>=1.3.2
|
|
31
31
|
Requires-Dist: httpx>=0.27
|
|
32
32
|
Requires-Dist: opentelemetry-api>=1.28.0
|
|
33
|
-
Requires-Dist: pydantic-graph==0.2.
|
|
33
|
+
Requires-Dist: pydantic-graph==0.2.13
|
|
34
34
|
Requires-Dist: pydantic>=2.10
|
|
35
35
|
Requires-Dist: typing-inspection>=0.4.0
|
|
36
36
|
Provides-Extra: a2a
|
|
37
|
-
Requires-Dist: fasta2a==0.2.
|
|
37
|
+
Requires-Dist: fasta2a==0.2.13; extra == 'a2a'
|
|
38
38
|
Provides-Extra: anthropic
|
|
39
39
|
Requires-Dist: anthropic>=0.52.0; extra == 'anthropic'
|
|
40
40
|
Provides-Extra: bedrock
|
|
@@ -48,7 +48,7 @@ Requires-Dist: cohere>=5.13.11; (platform_system != 'Emscripten') and extra == '
|
|
|
48
48
|
Provides-Extra: duckduckgo
|
|
49
49
|
Requires-Dist: duckduckgo-search>=7.0.0; extra == 'duckduckgo'
|
|
50
50
|
Provides-Extra: evals
|
|
51
|
-
Requires-Dist: pydantic-evals==0.2.
|
|
51
|
+
Requires-Dist: pydantic-evals==0.2.13; extra == 'evals'
|
|
52
52
|
Provides-Extra: google
|
|
53
53
|
Requires-Dist: google-genai>=1.15.0; extra == 'google'
|
|
54
54
|
Provides-Extra: groq
|
|
@@ -407,7 +407,7 @@ class OutputTool(Generic[OutputDataT]):
|
|
|
407
407
|
if wrap_validation_errors:
|
|
408
408
|
m = _messages.RetryPromptPart(
|
|
409
409
|
tool_name=tool_call.tool_name,
|
|
410
|
-
content=e.errors(include_url=False),
|
|
410
|
+
content=e.errors(include_url=False, include_context=False),
|
|
411
411
|
tool_call_id=tool_call.tool_call_id,
|
|
412
412
|
)
|
|
413
413
|
raise ToolRetryError(m) from e
|
|
@@ -431,7 +431,8 @@ class GeminiStreamedResponse(StreamedResponse):
|
|
|
431
431
|
if maybe_event is not None: # pragma: no branch
|
|
432
432
|
yield maybe_event
|
|
433
433
|
else:
|
|
434
|
-
|
|
434
|
+
if not any([key in gemini_part for key in ['function_response', 'thought']]):
|
|
435
|
+
raise AssertionError(f'Unexpected part: {gemini_part}') # pragma: no cover
|
|
435
436
|
|
|
436
437
|
async def _get_gemini_responses(self) -> AsyncIterator[_GeminiResponse]:
|
|
437
438
|
# This method exists to ensure we only yield completed items, so we don't need to worry about
|
|
@@ -605,6 +606,11 @@ class _GeminiFileDataPart(TypedDict):
|
|
|
605
606
|
file_data: Annotated[_GeminiFileData, pydantic.Field(alias='fileData')]
|
|
606
607
|
|
|
607
608
|
|
|
609
|
+
class _GeminiThoughtPart(TypedDict):
|
|
610
|
+
thought: bool
|
|
611
|
+
thought_signature: Annotated[str, pydantic.Field(alias='thoughtSignature')]
|
|
612
|
+
|
|
613
|
+
|
|
608
614
|
class _GeminiFunctionCallPart(TypedDict):
|
|
609
615
|
function_call: Annotated[_GeminiFunctionCall, pydantic.Field(alias='functionCall')]
|
|
610
616
|
|
|
@@ -665,6 +671,8 @@ def _part_discriminator(v: Any) -> str:
|
|
|
665
671
|
return 'inline_data' # pragma: no cover
|
|
666
672
|
elif 'fileData' in v:
|
|
667
673
|
return 'file_data' # pragma: no cover
|
|
674
|
+
elif 'thought' in v:
|
|
675
|
+
return 'thought'
|
|
668
676
|
elif 'functionCall' in v or 'function_call' in v:
|
|
669
677
|
return 'function_call'
|
|
670
678
|
elif 'functionResponse' in v or 'function_response' in v:
|
|
@@ -682,6 +690,7 @@ _GeminiPartUnion = Annotated[
|
|
|
682
690
|
Annotated[_GeminiFunctionResponsePart, pydantic.Tag('function_response')],
|
|
683
691
|
Annotated[_GeminiInlineDataPart, pydantic.Tag('inline_data')],
|
|
684
692
|
Annotated[_GeminiFileDataPart, pydantic.Tag('file_data')],
|
|
693
|
+
Annotated[_GeminiThoughtPart, pydantic.Tag('thought')],
|
|
685
694
|
],
|
|
686
695
|
pydantic.Discriminator(_part_discriminator),
|
|
687
696
|
]
|
|
@@ -399,7 +399,7 @@ class GeminiStreamedResponse(StreamedResponse):
|
|
|
399
399
|
raise UnexpectedModelBehavior('Streamed response has no content field') # pragma: no cover
|
|
400
400
|
assert candidate.content.parts is not None
|
|
401
401
|
for part in candidate.content.parts:
|
|
402
|
-
if part.text:
|
|
402
|
+
if part.text is not None:
|
|
403
403
|
yield self._parts_manager.handle_text_delta(vendor_part_id='content', content=part.text)
|
|
404
404
|
elif part.function_call:
|
|
405
405
|
maybe_event = self._parts_manager.handle_tool_call_delta(
|
|
@@ -447,7 +447,7 @@ def _process_response_from_parts(
|
|
|
447
447
|
) -> ModelResponse:
|
|
448
448
|
items: list[ModelResponsePart] = []
|
|
449
449
|
for part in parts:
|
|
450
|
-
if part.text:
|
|
450
|
+
if part.text is not None:
|
|
451
451
|
items.append(TextPart(content=part.text))
|
|
452
452
|
elif part.function_call:
|
|
453
453
|
assert part.function_call.name is not None
|
|
@@ -334,7 +334,9 @@ class OpenAIModel(Model):
|
|
|
334
334
|
items.append(TextPart(choice.message.content))
|
|
335
335
|
if choice.message.tool_calls is not None:
|
|
336
336
|
for c in choice.message.tool_calls:
|
|
337
|
-
|
|
337
|
+
part = ToolCallPart(c.function.name, c.function.arguments, tool_call_id=c.id)
|
|
338
|
+
part.tool_call_id = _guard_tool_call_id(part)
|
|
339
|
+
items.append(part)
|
|
338
340
|
return ModelResponse(
|
|
339
341
|
items,
|
|
340
342
|
usage=_map_usage(response),
|
|
@@ -392,7 +392,7 @@ class Tool(Generic[AgentDepsT]):
|
|
|
392
392
|
raise UnexpectedModelBehavior(f'Tool exceeded max retries count of {self.max_retries}') from exc
|
|
393
393
|
else:
|
|
394
394
|
if isinstance(exc, ValidationError):
|
|
395
|
-
content = exc.errors(include_url=False)
|
|
395
|
+
content = exc.errors(include_url=False, include_context=False)
|
|
396
396
|
else:
|
|
397
397
|
content = exc.message
|
|
398
398
|
return _messages.RetryPromptPart(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|