pydantic-ai 0.0.26__tar.gz → 0.0.28__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.
Files changed (61) hide show
  1. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/PKG-INFO +3 -3
  2. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/pyproject.toml +18 -32
  3. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/conftest.py +5 -0
  4. pydantic_ai-0.0.28/tests/models/cassettes/test_anthropic/test_image_url_input_invalid_mime_type.yaml +2856 -0
  5. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_gemini/test_image_as_binary_content_input.yaml +7 -7
  6. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_gemini/test_image_url_input.yaml +12 -12
  7. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/mock_async_stream.py +5 -1
  8. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_anthropic.py +60 -19
  9. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_cohere.py +29 -8
  10. pydantic_ai-0.0.28/tests/models/test_fallback.py +207 -0
  11. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_gemini.py +5 -4
  12. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_groq.py +42 -19
  13. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_mistral.py +56 -86
  14. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_model_function.py +7 -7
  15. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_openai.py +53 -28
  16. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_agent.py +14 -14
  17. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_examples.py +32 -4
  18. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_streaming.py +8 -8
  19. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/.gitignore +0 -0
  20. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/LICENSE +0 -0
  21. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/Makefile +0 -0
  22. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/README.md +0 -0
  23. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/__init__.py +0 -0
  24. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/assets/kiwi.png +0 -0
  25. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/assets/marcelo.mp3 +0 -0
  26. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/example_modules/README.md +0 -0
  27. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/example_modules/bank_database.py +0 -0
  28. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/example_modules/fake_database.py +0 -0
  29. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/example_modules/weather_service.py +0 -0
  30. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/graph/__init__.py +0 -0
  31. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/graph/test_graph.py +0 -0
  32. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/graph/test_history.py +0 -0
  33. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/graph/test_mermaid.py +0 -0
  34. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/graph/test_state.py +0 -0
  35. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/import_examples.py +0 -0
  36. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/json_body_serializer.py +0 -0
  37. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/__init__.py +0 -0
  38. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_anthropic/test_image_url_input.yaml +0 -0
  39. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_anthropic/test_multiple_parallel_tool_calls.yaml +0 -0
  40. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_groq/test_image_as_binary_content_input.yaml +0 -0
  41. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_groq/test_image_url_input.yaml +0 -0
  42. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_openai/test_audio_as_binary_content_input.yaml +0 -0
  43. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_openai/test_image_as_binary_content_input.yaml +0 -0
  44. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[developer].yaml +0 -0
  45. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/cassettes/test_openai/test_openai_o1_mini_system_role[system].yaml +0 -0
  46. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_instrumented.py +0 -0
  47. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_model.py +0 -0
  48. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_model_names.py +0 -0
  49. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_model_test.py +0 -0
  50. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/models/test_vertexai.py +0 -0
  51. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_deps.py +0 -0
  52. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_format_as_xml.py +0 -0
  53. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_json_body_serializer.py +0 -0
  54. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_live.py +0 -0
  55. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_logfire.py +0 -0
  56. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_parts_manager.py +0 -0
  57. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_tools.py +0 -0
  58. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_usage_limits.py +0 -0
  59. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/test_utils.py +0 -0
  60. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/typed_agent.py +0 -0
  61. {pydantic_ai-0.0.26 → pydantic_ai-0.0.28}/tests/typed_graph.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai
3
- Version: 0.0.26
3
+ Version: 0.0.28
4
4
  Summary: Agent Framework / shim to use Pydantic with LLMs
5
5
  Project-URL: Homepage, https://ai.pydantic.dev
6
6
  Project-URL: Source, https://github.com/pydantic/pydantic-ai
@@ -28,9 +28,9 @@ Classifier: Topic :: Internet
28
28
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
29
29
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
30
30
  Requires-Python: >=3.9
31
- Requires-Dist: pydantic-ai-slim[anthropic,cohere,groq,mistral,openai,vertexai]==0.0.26
31
+ Requires-Dist: pydantic-ai-slim[anthropic,cohere,groq,mistral,openai,vertexai]==0.0.28
32
32
  Provides-Extra: examples
33
- Requires-Dist: pydantic-ai-examples==0.0.26; extra == 'examples'
33
+ Requires-Dist: pydantic-ai-examples==0.0.28; extra == 'examples'
34
34
  Provides-Extra: logfire
35
35
  Requires-Dist: logfire>=2.3; extra == 'logfire'
36
36
  Description-Content-Type: text/markdown
@@ -4,11 +4,9 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pydantic-ai"
7
- version = "0.0.26"
7
+ version = "0.0.28"
8
8
  description = "Agent Framework / shim to use Pydantic with LLMs"
9
- authors = [
10
- { name = "Samuel Colvin", email = "samuel@pydantic.dev" },
11
- ]
9
+ authors = [{ name = "Samuel Colvin", email = "samuel@pydantic.dev" }]
12
10
  license = "MIT"
13
11
  readme = "README.md"
14
12
  classifiers = [
@@ -33,7 +31,9 @@ classifiers = [
33
31
  ]
34
32
  requires-python = ">=3.9"
35
33
 
36
- dependencies = ["pydantic-ai-slim[openai,vertexai,groq,anthropic,mistral,cohere]==0.0.26"]
34
+ dependencies = [
35
+ "pydantic-ai-slim[openai,vertexai,groq,anthropic,mistral,cohere]==0.0.28",
36
+ ]
37
37
 
38
38
  [project.urls]
39
39
  Homepage = "https://ai.pydantic.dev"
@@ -42,7 +42,7 @@ Documentation = "https://ai.pydantic.dev"
42
42
  Changelog = "https://github.com/pydantic/pydantic-ai/releases"
43
43
 
44
44
  [project.optional-dependencies]
45
- examples = ["pydantic-ai-examples==0.0.26"]
45
+ examples = ["pydantic-ai-examples==0.0.28"]
46
46
  logfire = ["logfire>=2.3"]
47
47
 
48
48
  [tool.uv.sources]
@@ -55,11 +55,7 @@ members = ["pydantic_ai_slim", "pydantic_graph", "examples"]
55
55
 
56
56
  [dependency-groups]
57
57
  # dev dependencies are defined in `pydantic-ai-slim/pyproject.toml` to allow for minimal testing
58
- lint = [
59
- "mypy>=1.11.2",
60
- "pyright>=1.1.388,<1.1.390",
61
- "ruff>=0.6.9",
62
- ]
58
+ lint = ["mypy>=1.11.2", "pyright>=1.1.388,<1.1.390", "ruff>=0.6.9"]
63
59
  docs = [
64
60
  "black>=24.10.0",
65
61
  "bs4>=0.0.2",
@@ -69,10 +65,7 @@ docs = [
69
65
  "mkdocs-material[imaging]>=9.5.45",
70
66
  "mkdocstrings-python>=1.12.2",
71
67
  ]
72
- docs-upload = [
73
- "algoliasearch>=4.12.0",
74
- "pydantic>=2.10.1",
75
- ]
68
+ docs-upload = ["algoliasearch>=4.12.0", "pydantic>=2.10.1"]
76
69
 
77
70
  [tool.hatch.build.targets.wheel]
78
71
  only-include = ["/README.md"]
@@ -92,14 +85,7 @@ include = [
92
85
  ]
93
86
 
94
87
  [tool.ruff.lint]
95
- extend-select = [
96
- "Q",
97
- "RUF100",
98
- "C90",
99
- "UP",
100
- "I",
101
- "D",
102
- ]
88
+ extend-select = ["Q", "RUF100", "C90", "UP", "I", "D"]
103
89
  flake8-quotes = { inline-quotes = "single", multiline-quotes = "double" }
104
90
  isort = { combine-as-imports = true, known-first-party = ["pydantic_ai"] }
105
91
  mccabe = { max-complexity = 15 }
@@ -133,9 +119,7 @@ include = ["pydantic_ai_slim", "pydantic_graph", "tests", "examples"]
133
119
  venvPath = ".venv"
134
120
  # see https://github.com/microsoft/pyright/issues/7771 - we don't want to error on decorated functions in tests
135
121
  # which are not otherwise used
136
- executionEnvironments = [
137
- { root = "tests", reportUnusedFunction = false },
138
- ]
122
+ executionEnvironments = [{ root = "tests", reportUnusedFunction = false }]
139
123
  exclude = ["examples/pydantic_ai_examples/weather_agent_gradio.py"]
140
124
 
141
125
  [tool.mypy]
@@ -145,14 +129,16 @@ strict = true
145
129
  [tool.pytest.ini_options]
146
130
  testpaths = "tests"
147
131
  xfail_strict = true
148
- filterwarnings = [
149
- "error",
150
- ]
132
+ filterwarnings = ["error"]
151
133
 
152
134
  # https://coverage.readthedocs.io/en/latest/config.html#run
153
135
  [tool.coverage.run]
154
136
  # required to avoid warnings about files created by create_module fixture
155
- include = ["pydantic_ai_slim/**/*.py", "pydantic_graph/**/*.py","tests/**/*.py"]
137
+ include = [
138
+ "pydantic_ai_slim/**/*.py",
139
+ "pydantic_graph/**/*.py",
140
+ "tests/**/*.py",
141
+ ]
156
142
  omit = ["tests/test_live.py", "tests/example_modules/*.py"]
157
143
  branch = true
158
144
 
@@ -180,8 +166,8 @@ exclude_lines = [
180
166
  ignore_no_config = true
181
167
 
182
168
  [tool.inline-snapshot.shortcuts]
183
- snap-fix=["create", "fix"]
184
- snap=["create"]
169
+ snap-fix = ["create", "fix"]
170
+ snap = ["create"]
185
171
 
186
172
  [tool.codespell]
187
173
  # Ref: https://github.com/codespell-project/codespell#using-a-config-file
@@ -186,6 +186,11 @@ def set_event_loop() -> Iterator[None]:
186
186
  new_loop.close()
187
187
 
188
188
 
189
+ def raise_if_exception(e: Any) -> None:
190
+ if isinstance(e, Exception):
191
+ raise e
192
+
193
+
189
194
  def pytest_recording_configure(config: Any, vcr: VCR):
190
195
  from . import json_body_serializer
191
196