pydantic-ai 1.27.0__tar.gz → 1.40.0__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.
@@ -43,7 +43,6 @@ typecheck-pyright:
43
43
  .PHONY: typecheck-mypy
44
44
  typecheck-mypy:
45
45
  uv run mypy
46
- uv run mypy typings/ --strict
47
46
 
48
47
  .PHONY: typecheck
49
48
  typecheck: typecheck-pyright ## Run static type checking
@@ -80,48 +79,23 @@ update-examples: ## Update documentation examples
80
79
  update-vcr-tests: ## Update tests using VCR that hit LLM APIs; note you'll need to set API keys as appropriate
81
80
  uv run -m pytest --record-mode=rewrite tests
82
81
 
83
- # `--no-strict` so you can build the docs without insiders packages
82
+ # `--no-strict` so you can build the docs without fixing all warnings
84
83
  .PHONY: docs
85
84
  docs: ## Build the documentation
86
85
  uv run mkdocs build --no-strict
87
86
 
88
- # `--no-strict` so you can build the docs without insiders packages
87
+ # `--no-strict` so you can build the docs without fixing all warnings
89
88
  .PHONY: docs-serve
90
89
  docs-serve: ## Build and serve the documentation
91
90
  uv run mkdocs serve --no-strict
92
91
 
93
- .PHONY: .docs-insiders-install
94
- .docs-insiders-install: ## Install insiders packages for docs if necessary
95
- ifeq ($(shell uv pip show mkdocs-material | grep -q insiders && echo 'installed'), installed)
96
- @echo 'insiders packages already installed'
97
- else ifeq ($(PPPR_TOKEN),)
98
- @echo "Error: PPPR_TOKEN is not set, can't install insiders packages"
99
- @exit 1
100
- else
101
- @echo 'installing insiders packages...'
102
- @uv pip install --reinstall --no-deps \
103
- --extra-index-url https://pydantic:${PPPR_TOKEN}@pppr.pydantic.dev/simple/ \
104
- mkdocs-material mkdocstrings-python
105
- endif
106
-
107
- .PHONY: docs-insiders
108
- docs-insiders: .docs-insiders-install ## Build the documentation using insiders packages
109
- uv run --no-sync mkdocs build -f mkdocs.insiders.yml
110
-
111
- .PHONY: docs-serve-insiders
112
- docs-serve-insiders: .docs-insiders-install ## Build and serve the documentation using insiders packages
113
- uv run --no-sync mkdocs serve -f mkdocs.insiders.yml
114
-
115
92
  .PHONY: cf-pages-build
116
93
  cf-pages-build: ## Install uv, install dependencies and build the docs, used on CloudFlare Pages
117
94
  curl -LsSf https://astral.sh/uv/install.sh | sh
118
95
  uv python install 3.12
119
96
  uv sync --python 3.12 --frozen --group docs
120
- uv pip install --reinstall --no-deps \
121
- --extra-index-url https://pydantic:${PPPR_TOKEN}@pppr.pydantic.dev/simple/ \
122
- mkdocs-material mkdocstrings-python
123
97
  uv pip freeze
124
- uv run --no-sync mkdocs build -f mkdocs.insiders.yml
98
+ uv run mkdocs build
125
99
 
126
100
  .PHONY: all
127
101
  all: format lint typecheck testcov ## Run code formatting, linting, static type checks, and tests with coverage report generation
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydantic-ai
3
- Version: 1.27.0
3
+ Version: 1.40.0
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
@@ -26,25 +26,27 @@ Classifier: Topic :: Internet
26
26
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
27
27
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
28
  Requires-Python: >=3.10
29
- Requires-Dist: pydantic-ai-slim[ag-ui,anthropic,bedrock,cli,cohere,evals,fastmcp,google,groq,huggingface,logfire,mcp,mistral,openai,retries,temporal,ui,vertexai]==1.27.0
29
+ Requires-Dist: pydantic-ai-slim[ag-ui,anthropic,bedrock,cli,cohere,evals,fastmcp,google,groq,huggingface,logfire,mcp,mistral,openai,retries,temporal,ui,vertexai]==1.40.0
30
30
  Provides-Extra: a2a
31
31
  Requires-Dist: fasta2a>=0.4.1; extra == 'a2a'
32
32
  Provides-Extra: dbos
33
- Requires-Dist: pydantic-ai-slim[dbos]==1.27.0; extra == 'dbos'
33
+ Requires-Dist: pydantic-ai-slim[dbos]==1.40.0; extra == 'dbos'
34
34
  Provides-Extra: examples
35
- Requires-Dist: pydantic-ai-examples==1.27.0; extra == 'examples'
35
+ Requires-Dist: pydantic-ai-examples==1.40.0; extra == 'examples'
36
36
  Provides-Extra: outlines-llamacpp
37
- Requires-Dist: pydantic-ai-slim[outlines-llamacpp]==1.27.0; extra == 'outlines-llamacpp'
37
+ Requires-Dist: pydantic-ai-slim[outlines-llamacpp]==1.40.0; extra == 'outlines-llamacpp'
38
38
  Provides-Extra: outlines-mlxlm
39
- Requires-Dist: pydantic-ai-slim[outlines-mlxlm]==1.27.0; (platform_system == 'Darwin' and platform_machine == 'arm64') and extra == 'outlines-mlxlm'
39
+ Requires-Dist: pydantic-ai-slim[outlines-mlxlm]==1.40.0; (platform_system == 'Darwin' and platform_machine == 'arm64') and extra == 'outlines-mlxlm'
40
40
  Provides-Extra: outlines-sglang
41
- Requires-Dist: pydantic-ai-slim[outlines-sglang]==1.27.0; extra == 'outlines-sglang'
41
+ Requires-Dist: pydantic-ai-slim[outlines-sglang]==1.40.0; extra == 'outlines-sglang'
42
42
  Provides-Extra: outlines-transformers
43
- Requires-Dist: pydantic-ai-slim[outlines-transformers]==1.27.0; extra == 'outlines-transformers'
43
+ Requires-Dist: pydantic-ai-slim[outlines-transformers]==1.40.0; extra == 'outlines-transformers'
44
44
  Provides-Extra: outlines-vllm-offline
45
- Requires-Dist: pydantic-ai-slim[outlines-vllm-offline]==1.27.0; extra == 'outlines-vllm-offline'
45
+ Requires-Dist: pydantic-ai-slim[outlines-vllm-offline]==1.40.0; extra == 'outlines-vllm-offline'
46
46
  Provides-Extra: prefect
47
- Requires-Dist: pydantic-ai-slim[prefect]==1.27.0; extra == 'prefect'
47
+ Requires-Dist: pydantic-ai-slim[prefect]==1.40.0; extra == 'prefect'
48
+ Provides-Extra: sentence-transformers
49
+ Requires-Dist: pydantic-ai-slim[sentence-transformers]==1.40.0; extra == 'sentence-transformers'
48
50
  Description-Content-Type: text/markdown
49
51
 
50
52
  <div align="center">
@@ -88,7 +90,7 @@ We built Pydantic AI with one simple aim: to bring that FastAPI feeling to GenAI
88
90
  [Pydantic Validation](https://docs.pydantic.dev/latest/) is the validation layer of the OpenAI SDK, the Google ADK, the Anthropic SDK, LangChain, LlamaIndex, AutoGPT, Transformers, CrewAI, Instructor and many more. _Why use the derivative when you can go straight to the source?_ :smiley:
89
91
 
90
92
  2. **Model-agnostic**:
91
- Supports virtually every [model](https://ai.pydantic.dev/models/overview) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Vertex AI, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud, and Outlines. If your favorite model or provider is not listed, you can easily implement a [custom model](https://ai.pydantic.dev/models/overview#custom-models).
93
+ Supports virtually every [model](https://ai.pydantic.dev/models/overview) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Vertex AI, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud, Alibaba Cloud, and Outlines. If your favorite model or provider is not listed, you can easily implement a [custom model](https://ai.pydantic.dev/models/overview#custom-models).
92
94
 
93
95
  3. **Seamless Observability**:
94
96
  Tightly [integrates](https://ai.pydantic.dev/logfire) with [Pydantic Logfire](https://pydantic.dev/logfire), our general-purpose OpenTelemetry observability platform, for real-time debugging, evals-based performance monitoring, and behavior, tracing, and cost tracking. If you already have an observability platform that supports OTel, you can [use that too](https://ai.pydantic.dev/logfire#alternative-observability-backends).
@@ -39,7 +39,7 @@ We built Pydantic AI with one simple aim: to bring that FastAPI feeling to GenAI
39
39
  [Pydantic Validation](https://docs.pydantic.dev/latest/) is the validation layer of the OpenAI SDK, the Google ADK, the Anthropic SDK, LangChain, LlamaIndex, AutoGPT, Transformers, CrewAI, Instructor and many more. _Why use the derivative when you can go straight to the source?_ :smiley:
40
40
 
41
41
  2. **Model-agnostic**:
42
- Supports virtually every [model](https://ai.pydantic.dev/models/overview) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Vertex AI, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud, and Outlines. If your favorite model or provider is not listed, you can easily implement a [custom model](https://ai.pydantic.dev/models/overview#custom-models).
42
+ Supports virtually every [model](https://ai.pydantic.dev/models/overview) and provider: OpenAI, Anthropic, Gemini, DeepSeek, Grok, Cohere, Mistral, and Perplexity; Azure AI Foundry, Amazon Bedrock, Google Vertex AI, Ollama, LiteLLM, Groq, OpenRouter, Together AI, Fireworks AI, Cerebras, Hugging Face, GitHub, Heroku, Vercel, Nebius, OVHcloud, Alibaba Cloud, and Outlines. If your favorite model or provider is not listed, you can easily implement a [custom model](https://ai.pydantic.dev/models/overview#custom-models).
43
43
 
44
44
  3. **Seamless Observability**:
45
45
  Tightly [integrates](https://ai.pydantic.dev/logfire) with [Pydantic Logfire](https://pydantic.dev/logfire), our general-purpose OpenTelemetry observability platform, for real-time debugging, evals-based performance monitoring, and behavior, tracing, and cost tracking. If you already have an observability platform that supports OTel, you can [use that too](https://ai.pydantic.dev/logfire#alternative-observability-backends).
@@ -59,6 +59,7 @@ outlines-llamacpp = ["pydantic-ai-slim[outlines-llamacpp]=={{ version }}"]
59
59
  outlines-mlxlm = ["pydantic-ai-slim[outlines-mlxlm]=={{ version }}; platform_system == 'Darwin' and platform_machine == 'arm64'"]
60
60
  outlines-sglang = ["pydantic-ai-slim[outlines-sglang]=={{ version }}"]
61
61
  outlines-vllm-offline = ["pydantic-ai-slim[outlines-vllm-offline]=={{ version }}"]
62
+ sentence-transformers = ["pydantic-ai-slim[sentence-transformers]=={{ version }}"]
62
63
 
63
64
  [project.urls]
64
65
  Homepage = "https://ai.pydantic.dev"
@@ -98,19 +99,20 @@ dev = [
98
99
  "dirty-equals>=0.9.0",
99
100
  "duckduckgo-search>=7.0.0",
100
101
  "inline-snapshot>=0.19.3",
101
- "pytest>=8.3.3",
102
+ "pytest>=9.0.0",
102
103
  "pytest-examples>=0.0.18",
103
104
  "pytest-mock>=3.14.0",
104
105
  "pytest-pretty>=1.3.0",
105
106
  "pytest-recording>=0.13.2",
106
107
  "diff-cover>=9.2.0",
107
- "boto3-stubs[bedrock-runtime]",
108
+ "boto3-stubs[bedrock-runtime]>=1.42.13",
108
109
  "strict-no-cover @ git+https://github.com/pydantic/strict-no-cover.git@7fc59da2c4dff919db2095a0f0e47101b657131d",
109
110
  "pytest-xdist>=3.6.1",
110
111
  # Needed for PyCharm users
111
112
  "pip>=25.2",
112
113
  "genai-prices>=0.0.28",
113
114
  "mcp-run-python>=0.0.20",
115
+ "brotli>=1.2.0",
114
116
  ]
115
117
  lint = ["mypy>=1.11.2", "pyright>=1.1.390", "ruff>=0.6.9"]
116
118
  docs = [
@@ -120,8 +122,8 @@ docs = [
120
122
  "mkdocs-glightbox>=0.4.0",
121
123
  "mkdocs-llmstxt>=0.2.0",
122
124
  "mkdocs-redirects>=1.2.2",
123
- "mkdocs-material[imaging]>=9.5.45",
124
- "mkdocstrings-python>=1.12.2",
125
+ "mkdocs-material[imaging]>=9.7.0",
126
+ "mkdocstrings-python>=2.0.0",
125
127
  "griffe-warnings-deprecated>=1.1.0",
126
128
  "pydantic-docs",
127
129
  ]
@@ -147,7 +149,6 @@ include = [
147
149
  "clai/**/*.py",
148
150
  "tests/**/*.py",
149
151
  "docs/**/*.py",
150
- "typings/**/*.pyi",
151
152
  ]
152
153
 
153
154
  [tool.ruff.lint]
@@ -195,11 +196,9 @@ quote-style = "single"
195
196
  "examples/**/*.py" = ["D101", "D103"]
196
197
  "tests/**/*.py" = ["D"]
197
198
  "docs/**/*.py" = ["D"]
198
- "typings/**/*.pyi" = ["F401", "PYI044", "PYI035", "ANN401"]
199
199
 
200
200
  [tool.pyright]
201
- stubPath = "typings"
202
- pythonVersion = "3.12"
201
+ pythonVersion = "3.10"
203
202
  typeCheckingMode = "strict"
204
203
  reportMissingTypeStubs = false
205
204
  reportUnnecessaryIsInstance = false
@@ -228,7 +227,6 @@ exclude = [
228
227
  [tool.mypy]
229
228
  files = "tests/typed_agent.py,tests/typed_graph.py"
230
229
  strict = true
231
- mypy_path = "typings"
232
230
 
233
231
  [tool.pytest.ini_options]
234
232
  testpaths = ["tests", "docs/.hooks"]
@@ -249,7 +247,6 @@ filterwarnings = [
249
247
  "ignore:unclosed <socket:ResourceWarning",
250
248
  "ignore:unclosed event loop:ResourceWarning",
251
249
  ]
252
- # addopts = ["--inline-snapshot=create,fix"]
253
250
 
254
251
  # https://coverage.readthedocs.io/en/latest/config.html#run
255
252
  [tool.coverage.run]
@@ -265,9 +262,11 @@ include = [
265
262
  "tests/**/*.py",
266
263
  ]
267
264
  omit = [
268
- "tests/test_live.py",
269
265
  "tests/example_modules/*.py",
270
266
  "pydantic_ai_slim/pydantic_ai/ext/aci.py", # aci-sdk is too niche to be added as an (optional) dependency
267
+ # TODO(Marcelo): Enable prefect coverage again.
268
+ "pydantic_ai_slim/pydantic_ai/durable_exec/prefect/*.py",
269
+ "tests/test_prefect.py",
271
270
  ]
272
271
  branch = true
273
272
  # Disable include-ignored warnings as --source is enabled automatically causing a self conflict as per:
@@ -311,6 +310,8 @@ exclude_lines = [
311
310
  'except ImportError as _import_error:',
312
311
  '$\s*pass$',
313
312
  'assert False',
313
+ '@pytest\.mark\.skip',
314
+ '@pytest\.mark\.xfail',
314
315
  ]
315
316
 
316
317
  [tool.logfire]
File without changes
File without changes