pydantic-ai-slim 0.0.49__py3-none-any.whl → 0.0.51__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/mcp.py CHANGED
@@ -114,7 +114,18 @@ class MCPServerStdio(MCPServer):
114
114
  from pydantic_ai import Agent
115
115
  from pydantic_ai.mcp import MCPServerStdio
116
116
 
117
- server = MCPServerStdio('npx', ['-y', '@pydantic/mcp-run-python', 'stdio']) # (1)!
117
+ server = MCPServerStdio( # (1)!
118
+ 'deno',
119
+ args=[
120
+ 'run',
121
+ '-N',
122
+ '-R=node_modules',
123
+ '-W=node_modules',
124
+ '--node-modules-dir=auto',
125
+ 'jsr:@pydantic/mcp-run-python',
126
+ 'stdio',
127
+ ]
128
+ )
118
129
  agent = Agent('openai:gpt-4o', mcp_servers=[server])
119
130
 
120
131
  async def main():
@@ -177,8 +188,7 @@ class MCPServerHTTP(MCPServer):
177
188
  ...
178
189
  ```
179
190
 
180
- 1. E.g. you might be connecting to a server run with `npx @pydantic/mcp-run-python sse`,
181
- see [MCP Run Python](../mcp/run-python.md) for more information.
191
+ 1. E.g. you might be connecting to a server run with [`mcp-run-python`](../mcp/run-python.md).
182
192
  2. This will connect to a server running on `localhost:3001`.
183
193
  """
184
194
 
@@ -135,7 +135,8 @@ class GeminiModel(Model):
135
135
  async with self._make_request(
136
136
  messages, False, cast(GeminiModelSettings, model_settings or {}), model_request_parameters
137
137
  ) as http_response:
138
- response = _gemini_response_ta.validate_json(await http_response.aread())
138
+ data = await http_response.aread()
139
+ response = _gemini_response_ta.validate_json(data)
139
140
  return self._process_response(response), _metadata_as_usage(response)
140
141
 
141
142
  @asynccontextmanager
@@ -640,10 +641,7 @@ class _GeminiFunction(TypedDict):
640
641
 
641
642
  def _function_from_abstract_tool(tool: ToolDefinition) -> _GeminiFunction:
642
643
  json_schema = _GeminiJsonSchema(tool.parameters_json_schema).simplify()
643
- f = _GeminiFunction(
644
- name=tool.name,
645
- description=tool.description,
646
- )
644
+ f = _GeminiFunction(name=tool.name, description=tool.description)
647
645
  if json_schema.get('properties'):
648
646
  f['parameters'] = json_schema
649
647
  return f
@@ -770,6 +768,9 @@ class _GeminiJsonSchema:
770
768
  def _simplify(self, schema: dict[str, Any], refs_stack: tuple[str, ...]) -> None:
771
769
  schema.pop('title', None)
772
770
  schema.pop('default', None)
771
+ schema.pop('$schema', None)
772
+ schema.pop('exclusiveMaximum', None)
773
+ schema.pop('exclusiveMinimum', None)
773
774
  if ref := schema.pop('$ref', None):
774
775
  # noinspection PyTypeChecker
775
776
  key = re.sub(r'^#/\$defs/', '', ref)
@@ -630,7 +630,8 @@ class OpenAIResponsesModel(Model):
630
630
  'parameters': f.parameters_json_schema,
631
631
  'type': 'function',
632
632
  'description': f.description,
633
- 'strict': True,
633
+ # TODO(Marcelo): We should make this configurable, and if True, set `additionalProperties` to False.
634
+ 'strict': False,
634
635
  }
635
636
 
636
637
  async def _map_message(self, messages: list[ModelMessage]) -> tuple[str, list[responses.ResponseInputItemParam]]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai-slim
3
- Version: 0.0.49
3
+ Version: 0.0.51
4
4
  Summary: Agent Framework / shim to use Pydantic with LLMs, slim package
5
5
  Author-email: Samuel Colvin <samuel@pydantic.dev>
6
6
  License-Expression: MIT
@@ -29,7 +29,7 @@ Requires-Dist: exceptiongroup; python_version < '3.11'
29
29
  Requires-Dist: griffe>=1.3.2
30
30
  Requires-Dist: httpx>=0.27
31
31
  Requires-Dist: opentelemetry-api>=1.28.0
32
- Requires-Dist: pydantic-graph==0.0.49
32
+ Requires-Dist: pydantic-graph==0.0.51
33
33
  Requires-Dist: pydantic>=2.10
34
34
  Requires-Dist: typing-inspection>=0.4.0
35
35
  Provides-Extra: anthropic
@@ -45,7 +45,7 @@ Requires-Dist: cohere>=5.13.11; (platform_system != 'Emscripten') and extra == '
45
45
  Provides-Extra: duckduckgo
46
46
  Requires-Dist: duckduckgo-search>=7.0.0; extra == 'duckduckgo'
47
47
  Provides-Extra: evals
48
- Requires-Dist: pydantic-evals==0.0.49; extra == 'evals'
48
+ Requires-Dist: pydantic-evals==0.0.51; extra == 'evals'
49
49
  Provides-Extra: groq
50
50
  Requires-Dist: groq>=0.15.0; extra == 'groq'
51
51
  Provides-Extra: logfire
@@ -11,7 +11,7 @@ pydantic_ai/_utils.py,sha256=VXbR6FG6WQU_TTN1NMmBDbZ6e6DT7PDiUiBHFHf348U,9703
11
11
  pydantic_ai/agent.py,sha256=qBUE9uPgomSj09sHe6kQYxjXGMVsRs3nkPn5neRVlYg,69285
12
12
  pydantic_ai/exceptions.py,sha256=gvbFsFkAzSXOo_d1nfjy09kDHUGv1j5q70Uk-wKYGi8,3167
13
13
  pydantic_ai/format_as_xml.py,sha256=QE7eMlg5-YUMw1_2kcI3h0uKYPZZyGkgXFDtfZTMeeI,4480
14
- pydantic_ai/mcp.py,sha256=2Unphn9azcQVtf4_wXsqypkrWaLUoKoUCK9WAp-OOsI,8108
14
+ pydantic_ai/mcp.py,sha256=wlu3GCdcjgsag75cyuTron1kdTQOWkM0j5hNJxf0JkE,8242
15
15
  pydantic_ai/messages.py,sha256=IQS6vabH72yhvTQY1ciQxRqJDHpGMMR0MKiO5xcJ0SE,27112
16
16
  pydantic_ai/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  pydantic_ai/result.py,sha256=LXKxRzy_rGMkdZ8xJ7yknPP3wGZtGNeZl-gh5opXbaQ,22542
@@ -27,11 +27,11 @@ pydantic_ai/models/bedrock.py,sha256=EmnBwxx_FzKMM8xAed_1aTmDwASWo26GA6Q8Z92waVc
27
27
  pydantic_ai/models/cohere.py,sha256=UTRCl3sa5-ptceg7k9WqLMIhNo5oFExUPMpLLi-A46c,11328
28
28
  pydantic_ai/models/fallback.py,sha256=y0bYXM3DfzJNAsyyMzclt33lzZazL-5_hwdgc33gfuM,4876
29
29
  pydantic_ai/models/function.py,sha256=HUSgPB3mKVfYI0OSJJJJRiQN-yeewjYIbrtrPfsvlgI,11365
30
- pydantic_ai/models/gemini.py,sha256=0N5ccI5HsCLaPd2-jxareQvrAePKSALOiRmV0ufxIcc,33336
30
+ pydantic_ai/models/gemini.py,sha256=28cnJqi7b06sllzXHLJBeIpYu0VS32Z4rnbEwDO7dQo,33463
31
31
  pydantic_ai/models/groq.py,sha256=IbO2jMNC5yiYRuUJf-j4blpPvoQDromQNBKJyPjs2A4,16518
32
32
  pydantic_ai/models/instrumented.py,sha256=ErFRDiOehOYlJBp4mSNj7yEIMtMqjlGcamEAwgW_Il4,11163
33
33
  pydantic_ai/models/mistral.py,sha256=8pdG9oRW6Dx7H5P88ZgiRIZbkGkPUfEateuyvzoULOE,27439
34
- pydantic_ai/models/openai.py,sha256=asLsbtyQwvAtLjdJs4B87qE9ylqWJmWCIoWs2xvvjM0,40675
34
+ pydantic_ai/models/openai.py,sha256=mUnFp6Ifj9pUgOkwXNu8p5QC2lAD9-qmLHSfakObobI,40789
35
35
  pydantic_ai/models/test.py,sha256=qQ8ZIaVRdbJv-tKGu6lrdakVAhOsTlyf68TFWyGwOWE,16861
36
36
  pydantic_ai/models/wrapper.py,sha256=ff6JPTuIv9C_6Zo4kyYIO7Cn0VI1uSICz1v1aKUyeOc,1506
37
37
  pydantic_ai/providers/__init__.py,sha256=lsJn3BStrPMMAFWEkCYPyfMj3fEVfaeS2xllnvE6Gdk,2489
@@ -45,7 +45,7 @@ pydantic_ai/providers/google_vertex.py,sha256=WAwPxKTARVzs8DFs2veEUOJSur0krDOo9-
45
45
  pydantic_ai/providers/groq.py,sha256=DoY6qkfhuemuKB5JXhUkqG-3t1HQkxwSXoE_kHQIAK0,2788
46
46
  pydantic_ai/providers/mistral.py,sha256=fcR1uSwORo0jtevX7-wOjvcfT8ojMAaKY81uN5uYymM,2661
47
47
  pydantic_ai/providers/openai.py,sha256=ePF-QWwLkGkSE5w245gTTDVR3VoTIUqFoIhQ0TAoUiA,2866
48
- pydantic_ai_slim-0.0.49.dist-info/METADATA,sha256=lj5N1y3Dff7zJqTUQJy-z-kRBa7Fh3odZRuDW_GqOFc,3555
49
- pydantic_ai_slim-0.0.49.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
- pydantic_ai_slim-0.0.49.dist-info/entry_points.txt,sha256=KxQSmlMS8GMTkwTsl4_q9a5nJvBjj3HWeXx688wLrKg,45
51
- pydantic_ai_slim-0.0.49.dist-info/RECORD,,
48
+ pydantic_ai_slim-0.0.51.dist-info/METADATA,sha256=iVGX_00tmS8h4x6YYXmMnQNF-IrPZCVnWvFJdHw9oJY,3555
49
+ pydantic_ai_slim-0.0.51.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
50
+ pydantic_ai_slim-0.0.51.dist-info/entry_points.txt,sha256=KxQSmlMS8GMTkwTsl4_q9a5nJvBjj3HWeXx688wLrKg,45
51
+ pydantic_ai_slim-0.0.51.dist-info/RECORD,,