Skip to content

Commit aebf039

Browse files
committed
Merge branch 'main' into vercel-ai-chat
# Conflicts: # pyproject.toml # tests/models/test_deepseek.py # tests/models/test_huggingface.py # uv.lock
2 parents bd6cbc3 + c9e9d93 commit aebf039

File tree

181 files changed

+30036
-3152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+30036
-3152
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@ permissions:
1818

1919
jobs:
2020
lint:
21+
name: lint on ${{ matrix.python-version }}
2122
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
# Typecheck both Python 3.10 and 3.13. We've had issues due to not checking against both.
27+
python-version: ["3.10", "3.13"]
28+
env:
29+
UV_PYTHON: ${{ matrix.python-version }}
30+
PYRIGHT_PYTHON: ${{ matrix.python-version }}
2231
steps:
2332
- uses: actions/checkout@v4
2433

@@ -129,7 +138,7 @@ jobs:
129138
test:
130139
name: test on ${{ matrix.python-version }} (${{ matrix.install.name }})
131140
runs-on: ubuntu-latest
132-
timeout-minutes: 10
141+
timeout-minutes: 15
133142
strategy:
134143
fail-fast: false
135144
matrix:
@@ -160,6 +169,15 @@ jobs:
160169

161170
- run: uv run mcp-run-python example --deps=numpy
162171
- run: uv sync --only-dev
172+
173+
- name: cache HuggingFace models
174+
uses: actions/cache@v4
175+
with:
176+
path: ~/.cache/huggingface
177+
key: hf-${{ runner.os }}-${{ hashFiles('**/pyproject.toml') }}
178+
restore-keys: |
179+
hf-${{ runner.os }}-
180+
163181
- run: uv run ${{ matrix.install.command }} coverage run -m pytest --durations=100 -n auto --dist=loadgroup
164182
env:
165183
COVERAGE_FILE: .coverage/.coverage.${{ matrix.python-version }}-${{ matrix.install.name }}
@@ -174,7 +192,7 @@ jobs:
174192
test-lowest-versions:
175193
name: test on ${{ matrix.python-version }} (lowest-versions)
176194
runs-on: ubuntu-latest
177-
timeout-minutes: 10
195+
timeout-minutes: 15
178196
strategy:
179197
fail-fast: false
180198
matrix:
@@ -197,6 +215,15 @@ jobs:
197215
- run: mkdir .coverage
198216

199217
- run: uv sync --group dev
218+
219+
- name: cache HuggingFace models
220+
uses: actions/cache@v4
221+
with:
222+
path: ~/.cache/huggingface
223+
key: hf-${{ runner.os }}-${{ hashFiles('**/pyproject.toml') }}
224+
restore-keys: |
225+
hf-${{ runner.os }}-
226+
200227
- run: uv run mcp-run-python example --deps=numpy
201228

202229
- run: unset UV_FROZEN
@@ -230,6 +257,14 @@ jobs:
230257
with:
231258
enable-cache: true
232259

260+
- name: cache HuggingFace models
261+
uses: actions/cache@v4
262+
with:
263+
path: ~/.cache/huggingface
264+
key: hf-${{ runner.os }}-${{ hashFiles('**/pyproject.toml') }}
265+
restore-keys: |
266+
hf-${{ runner.os }}-
267+
233268
- run: uv run --all-extras python tests/import_examples.py
234269

235270
coverage:

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ lint: ## Lint the code
3636

3737
.PHONY: typecheck-pyright
3838
typecheck-pyright:
39+
@# To typecheck for a specific version of python, run 'make install-all-python' then set environment variable PYRIGHT_PYTHON=3.10 or similar
3940
@# PYRIGHT_PYTHON_IGNORE_WARNINGS avoids the overhead of making a request to github on every invocation
40-
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright
41+
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright $(if $(PYRIGHT_PYTHON),--pythonversion $(PYRIGHT_PYTHON))
4142

4243
.PHONY: typecheck-mypy
4344
typecheck-mypy:
@@ -51,7 +52,8 @@ typecheck-both: typecheck-pyright typecheck-mypy
5152

5253
.PHONY: test
5354
test: ## Run tests and collect coverage data
54-
uv run coverage run -m pytest -n auto --dist=loadgroup --durations=20
55+
@# To test using a specific version of python, run 'make install-all-python' then set environment variable PYTEST_PYTHON=3.10 or similar
56+
$(if $(PYTEST_PYTHON),UV_PROJECT_ENVIRONMENT=.venv$(subst .,,$(PYTEST_PYTHON))) uv run $(if $(PYTEST_PYTHON),--python $(PYTEST_PYTHON)) coverage run -m pytest -n auto --dist=loadgroup --durations=20
5557
@uv run coverage combine
5658
@uv run coverage report
5759

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ We built Pydantic AI with one simple aim: to bring that FastAPI feeling to GenAI
3939
[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:
4040

4141
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. 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, 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).
4343

4444
3. **Seamless Observability**:
4545
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).

docs/agents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ try:
739739
except UnexpectedModelBehavior as e:
740740
print(e) # (1)!
741741
"""
742-
Safety settings triggered, body:
742+
Content filter 'SAFETY' triggered, body:
743743
<safety settings details>
744744
"""
745745
```

docs/api/models/outlines.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# `pydantic_ai.models.outlines`
2+
3+
## Setup
4+
5+
For details on how to set up this model, see [model configuration for Outlines](../../models/outlines.md).
6+
7+
::: pydantic_ai.models.outlines

docs/api/providers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@
4343
::: pydantic_ai.providers.litellm.LiteLLMProvider
4444

4545
::: pydantic_ai.providers.nebius.NebiusProvider
46+
47+
::: pydantic_ai.providers.ovhcloud.OVHcloudProvider

docs/api/pydantic_graph/beta.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `pydantic_graph.beta`
2+
3+
::: pydantic_graph.beta
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `pydantic_graph.beta.decision`
2+
3+
::: pydantic_graph.beta.decision
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `pydantic_graph.beta.graph`
2+
3+
::: pydantic_graph.beta.graph
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `pydantic_graph.beta.graph_builder`
2+
3+
::: pydantic_graph.beta.graph_builder

0 commit comments

Comments
 (0)