Skip to content

Commit 168bc8d

Browse files
committed
Revert "Merge branch 'main' into fix/google-continue-on-malformed-function-call"
This reverts commit ba193cb, reversing changes made to 2997f66.
1 parent ba193cb commit 168bc8d

File tree

331 files changed

+5897
-53450
lines changed

Some content is hidden

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

331 files changed

+5897
-53450
lines changed

.github/workflows/after-ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
steps:
1717
- uses: astral-sh/setup-uv@v5
1818
with:
19+
enable-cache: true
1920
python-version: "3.12"
2021

2122
- uses: dawidd6/action-download-artifact@v6
@@ -53,9 +54,8 @@ jobs:
5354

5455
- uses: astral-sh/setup-uv@v5
5556
with:
56-
python-version: "3.12"
5757
enable-cache: true
58-
cache-suffix: deploy-docs-preview
58+
python-version: "3.12"
5959

6060
- uses: dawidd6/action-download-artifact@v6
6161
with:
@@ -65,7 +65,6 @@ jobs:
6565
commit: ${{ github.event.workflow_run.head_sha }}
6666
allow_forks: true
6767
workflow_conclusion: completed
68-
if_no_artifact_found: warn
6968

7069
- uses: cloudflare/wrangler-action@v3
7170
id: deploy

.github/workflows/ci.yml

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,13 @@ permissions:
1818

1919
jobs:
2020
lint:
21-
name: lint on ${{ matrix.python-version }}
2221
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-
PYRIGHT_PYTHON: ${{ matrix.python-version }}
3022
steps:
3123
- uses: actions/checkout@v4
3224

3325
- uses: astral-sh/setup-uv@v5
3426
with:
35-
python-version: ${{ matrix.python-version }}
3627
enable-cache: true
37-
cache-suffix: lint
3828

3929
- name: Install dependencies
4030
run: uv sync --all-extras --all-packages --group lint
@@ -57,7 +47,6 @@ jobs:
5747
- uses: astral-sh/setup-uv@v5
5848
with:
5949
enable-cache: true
60-
cache-suffix: mypy
6150

6251
- name: Install dependencies
6352
run: uv sync --no-dev --group lint
@@ -72,7 +61,6 @@ jobs:
7261
- uses: astral-sh/setup-uv@v5
7362
with:
7463
enable-cache: true
75-
cache-suffix: docs
7664

7765
- run: uv sync --group docs
7866

@@ -110,7 +98,6 @@ jobs:
11098
- uses: astral-sh/setup-uv@v5
11199
with:
112100
enable-cache: true
113-
cache-suffix: live
114101

115102
- uses: pydantic/ollama-action@v3
116103
with:
@@ -142,7 +129,7 @@ jobs:
142129
test:
143130
name: test on ${{ matrix.python-version }} (${{ matrix.install.name }})
144131
runs-on: ubuntu-latest
145-
timeout-minutes: 20
132+
timeout-minutes: 10
146133
strategy:
147134
fail-fast: false
148135
matrix:
@@ -155,35 +142,24 @@ jobs:
155142
- name: all-extras
156143
command: "--all-extras"
157144
env:
145+
UV_PYTHON: ${{ matrix.python-version }}
158146
CI: true
159147
COVERAGE_PROCESS_START: ./pyproject.toml
160148
steps:
161149
- uses: actions/checkout@v4
162150

163151
- uses: astral-sh/setup-uv@v5
164152
with:
165-
python-version: ${{ matrix.python-version }}
166153
enable-cache: true
167-
cache-suffix: ${{ matrix.install.name }}
168154

169155
- uses: denoland/setup-deno@v2
170156
with:
171157
deno-version: v2.x
172158

173159
- run: mkdir .coverage
174160

175-
- run: uv sync --only-dev
176-
177161
- run: uv run mcp-run-python example --deps=numpy
178-
179-
- name: cache HuggingFace models
180-
uses: actions/cache@v4
181-
with:
182-
path: ~/.cache/huggingface
183-
key: hf-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
184-
restore-keys: |
185-
hf-${{ runner.os }}-
186-
162+
- run: uv sync --only-dev
187163
- run: uv run ${{ matrix.install.command }} coverage run -m pytest --durations=100 -n auto --dist=loadgroup
188164
env:
189165
COVERAGE_FILE: .coverage/.coverage.${{ matrix.python-version }}-${{ matrix.install.name }}
@@ -198,22 +174,21 @@ jobs:
198174
test-lowest-versions:
199175
name: test on ${{ matrix.python-version }} (lowest-versions)
200176
runs-on: ubuntu-latest
201-
timeout-minutes: 20
177+
timeout-minutes: 10
202178
strategy:
203179
fail-fast: false
204180
matrix:
205181
python-version: ["3.10", "3.11", "3.12", "3.13"]
206182
env:
183+
UV_PYTHON: ${{ matrix.python-version }}
207184
CI: true
208185
COVERAGE_PROCESS_START: ./pyproject.toml
209186
steps:
210187
- uses: actions/checkout@v4
211188

212189
- uses: astral-sh/setup-uv@v5
213190
with:
214-
python-version: ${{ matrix.python-version }}
215191
enable-cache: true
216-
cache-suffix: lowest-versions
217192

218193
- uses: denoland/setup-deno@v2
219194
with:
@@ -222,17 +197,8 @@ jobs:
222197
- run: mkdir .coverage
223198

224199
- run: uv sync --group dev
225-
226200
- run: uv run mcp-run-python example --deps=numpy
227201

228-
- name: cache HuggingFace models
229-
uses: actions/cache@v4
230-
with:
231-
path: ~/.cache/huggingface
232-
key: hf-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
233-
restore-keys: |
234-
hf-${{ runner.os }}-
235-
236202
- run: unset UV_FROZEN
237203

238204
- run: uv run --all-extras --resolution lowest-direct coverage run -m pytest --durations=100 -n auto --dist=loadgroup
@@ -255,23 +221,14 @@ jobs:
255221
matrix:
256222
python-version: ["3.11", "3.12", "3.13"]
257223
env:
224+
UV_PYTHON: ${{ matrix.python-version }}
258225
CI: true
259226
steps:
260227
- uses: actions/checkout@v4
261228

262229
- uses: astral-sh/setup-uv@v5
263230
with:
264-
python-version: ${{ matrix.python-version }}
265231
enable-cache: true
266-
cache-suffix: examples
267-
268-
- name: cache HuggingFace models
269-
uses: actions/cache@v4
270-
with:
271-
path: ~/.cache/huggingface
272-
key: hf-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}
273-
restore-keys: |
274-
hf-${{ runner.os }}-
275232

276233
- run: uv run --all-extras python tests/import_examples.py
277234

@@ -293,7 +250,6 @@ jobs:
293250
- uses: astral-sh/setup-uv@v5
294251
with:
295252
enable-cache: true
296-
cache-suffix: dev
297253

298254
- run: uv sync --group dev
299255
- run: uv run coverage combine
@@ -349,7 +305,6 @@ jobs:
349305
- uses: astral-sh/setup-uv@v5
350306
with:
351307
enable-cache: true
352-
cache-suffix: docs-upload
353308

354309
- uses: actions/download-artifact@v4
355310
with:
@@ -391,7 +346,6 @@ jobs:
391346
- uses: astral-sh/setup-uv@v5
392347
with:
393348
enable-cache: true
394-
cache-suffix: deploy-docs-preview
395349

396350
- uses: actions/download-artifact@v4
397351
with:
@@ -439,7 +393,6 @@ jobs:
439393
- uses: astral-sh/setup-uv@v5
440394
with:
441395
enable-cache: true
442-
cache-suffix: release
443396

444397
- run: uv build --all-packages
445398

.github/workflows/claude.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
- uses: astral-sh/setup-uv@v5
3838
with:
3939
enable-cache: true
40-
cache-suffix: claude-code
4140

4241
- uses: denoland/setup-deno@v2
4342
with:

.github/workflows/manually-deploy-docs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
- uses: astral-sh/setup-uv@v5
1414
with:
1515
enable-cache: true
16-
cache-suffix: docs
1716

1817
- run: uv sync --group docs
1918

@@ -55,7 +54,6 @@ jobs:
5554
- uses: astral-sh/setup-uv@v5
5655
with:
5756
enable-cache: true
58-
cache-suffix: docs-upload
5957

6058
- uses: actions/download-artifact@v4
6159
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env*/
1010
/TODO.md
1111
/postgres-data/
1212
.DS_Store
13-
.chat_app_messages.sqlite
13+
examples/pydantic_ai_examples/.chat_app_messages.sqlite
1414
.cache/
1515
.vscode/
1616
/question_graph_history.json

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
2828

2929
**Model Integration (`pydantic_ai_slim/pydantic_ai/models/`)**
3030
- Unified interface across providers: OpenAI, Anthropic, Google, Groq, Cohere, Mistral, Bedrock, HuggingFace
31-
- Model strings: `"openai:gpt-5"`, `"anthropic:claude-sonnet-4-5"`, `"google:gemini-2.5-pro"`
31+
- Model strings: `"openai:gpt-4o"`, `"anthropic:claude-3-5-sonnet"`, `"google:gemini-1.5-pro"`
3232
- `ModelRequestParameters` for configuration, `StreamedResponse` for streaming
3333

3434
**Graph-based Execution (`pydantic_graph/` + `_agent_graph.py`)**
@@ -55,7 +55,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
5555
class MyDeps:
5656
database: DatabaseConn
5757

58-
agent = Agent('openai:gpt-5', deps_type=MyDeps)
58+
agent = Agent('openai:gpt-4o', deps_type=MyDeps)
5959

6060
@agent.tool
6161
async def get_data(ctx: RunContext[MyDeps]) -> str:
@@ -69,7 +69,7 @@ class OutputModel(BaseModel):
6969
confidence: float
7070

7171
agent: Agent[MyDeps, OutputModel] = Agent(
72-
'openai:gpt-5',
72+
'openai:gpt-4o',
7373
deps_type=MyDeps,
7474
output_type=OutputModel
7575
)

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ 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
4039
@# PYRIGHT_PYTHON_IGNORE_WARNINGS avoids the overhead of making a request to github on every invocation
41-
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright $(if $(PYRIGHT_PYTHON),--pythonversion $(PYRIGHT_PYTHON))
40+
PYRIGHT_PYTHON_IGNORE_WARNINGS=1 uv run pyright
4241

4342
.PHONY: typecheck-mypy
4443
typecheck-mypy:
@@ -52,8 +51,7 @@ typecheck-both: typecheck-pyright typecheck-mypy
5251

5352
.PHONY: test
5453
test: ## Run tests and collect coverage data
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
54+
uv run coverage run -m pytest -n auto --dist=loadgroup --durations=20
5755
@uv run coverage combine
5856
@uv run coverage report
5957

README.md

Lines changed: 3 additions & 3 deletions
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, 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. 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).
@@ -50,8 +50,8 @@ Designed to give your IDE or AI coding agent as much context as possible for aut
5050
5. **Powerful Evals**:
5151
Enables you to systematically test and [evaluate](https://ai.pydantic.dev/evals) the performance and accuracy of the agentic systems you build, and monitor the performance over time in Pydantic Logfire.
5252

53-
6. **MCP, A2A, and UI**:
54-
Integrates the [Model Context Protocol](https://ai.pydantic.dev/mcp/overview), [Agent2Agent](https://ai.pydantic.dev/a2a), and various [UI event stream](https://ai.pydantic.dev/ui/overview) standards to give your agent access to external tools and data, let it interoperate with other agents, and build interactive applications with streaming event-based communication.
53+
6. **MCP, A2A, and AG-UI**:
54+
Integrates the [Model Context Protocol](https://ai.pydantic.dev/mcp/client), [Agent2Agent](https://ai.pydantic.dev/a2a), and [AG-UI](https://ai.pydantic.dev/ag-ui) standards to give your agent access to external tools and data, let it interoperate with other agents, and build interactive applications with streaming event-based communication.
5555

5656
7. **Human-in-the-Loop Tool Approval**:
5757
Easily lets you flag that certain tool calls [require approval](https://ai.pydantic.dev/deferred-tools#human-in-the-loop-tool-approval) before they can proceed, possibly depending on tool call arguments, conversation history, or user preferences.

clai/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ positional arguments:
7070
options:
7171
-h, --help show this help message and exit
7272
-m [MODEL], --model [MODEL]
73-
Model to use, in format "<provider>:<model>" e.g. "openai:gpt-5" or "anthropic:claude-sonnet-4-5". Defaults to "openai:gpt-5".
73+
Model to use, in format "<provider>:<model>" e.g. "openai:gpt-4.1" or "anthropic:claude-sonnet-4-0". Defaults to "openai:gpt-4.1".
7474
-a AGENT, --agent AGENT
7575
Custom Agent to use, in format "module:variable", e.g. "mymodule.submodule:my_agent"
7676
-l, --list-models List all available models and exit

0 commit comments

Comments
 (0)