Skip to content

Commit 5da5f7d

Browse files
authored
Merge branch 'main' into main
2 parents afb03ac + 0e1f0d5 commit 5da5f7d

File tree

139 files changed

+27898
-987
lines changed

Some content is hidden

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

139 files changed

+27898
-987
lines changed

.github/workflows/ci.yml

Lines changed: 40 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:
@@ -151,6 +160,7 @@ jobs:
151160
- uses: astral-sh/setup-uv@v5
152161
with:
153162
enable-cache: true
163+
prune-cache: false
154164

155165
- uses: denoland/setup-deno@v2
156166
with:
@@ -160,6 +170,15 @@ jobs:
160170

161171
- run: uv run mcp-run-python example --deps=numpy
162172
- run: uv sync --only-dev
173+
174+
- name: cache HuggingFace models
175+
uses: actions/cache@v4
176+
with:
177+
path: ~/.cache/huggingface
178+
key: hf-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
179+
restore-keys: |
180+
hf-${{ runner.os }}-
181+
163182
- run: uv run ${{ matrix.install.command }} coverage run -m pytest --durations=100 -n auto --dist=loadgroup
164183
env:
165184
COVERAGE_FILE: .coverage/.coverage.${{ matrix.python-version }}-${{ matrix.install.name }}
@@ -174,7 +193,7 @@ jobs:
174193
test-lowest-versions:
175194
name: test on ${{ matrix.python-version }} (lowest-versions)
176195
runs-on: ubuntu-latest
177-
timeout-minutes: 10
196+
timeout-minutes: 15
178197
strategy:
179198
fail-fast: false
180199
matrix:
@@ -189,6 +208,7 @@ jobs:
189208
- uses: astral-sh/setup-uv@v5
190209
with:
191210
enable-cache: true
211+
prune-cache: false
192212

193213
- uses: denoland/setup-deno@v2
194214
with:
@@ -197,6 +217,15 @@ jobs:
197217
- run: mkdir .coverage
198218

199219
- run: uv sync --group dev
220+
221+
- name: cache HuggingFace models
222+
uses: actions/cache@v4
223+
with:
224+
path: ~/.cache/huggingface
225+
key: hf-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
226+
restore-keys: |
227+
hf-${{ runner.os }}-
228+
200229
- run: uv run mcp-run-python example --deps=numpy
201230

202231
- run: unset UV_FROZEN
@@ -229,6 +258,15 @@ jobs:
229258
- uses: astral-sh/setup-uv@v5
230259
with:
231260
enable-cache: true
261+
prune-cache: false
262+
263+
- name: cache HuggingFace models
264+
uses: actions/cache@v4
265+
with:
266+
path: ~/.cache/huggingface
267+
key: hf-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
268+
restore-keys: |
269+
hf-${{ runner.os }}-
232270
233271
- run: uv run --all-extras python tests/import_examples.py
234272

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, OVHcloud. 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
@@ -736,7 +736,7 @@ try:
736736
except UnexpectedModelBehavior as e:
737737
print(e) # (1)!
738738
"""
739-
Safety settings triggered, body:
739+
Content filter 'SAFETY' triggered, body:
740740
<safety settings details>
741741
"""
742742
```

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/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
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `pydantic_graph.beta.join`
2+
3+
::: pydantic_graph.beta.join

0 commit comments

Comments
 (0)