Skip to content

Commit 24acc2d

Browse files
authored
Merge branch 'main' into enter_context_in_iter
2 parents 707d4c3 + 3e1f634 commit 24acc2d

26 files changed

+1872
-180
lines changed

.github/workflows/claude.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
env:
14+
UV_PYTHON: 3.13
15+
UV_FROZEN: "1"
16+
17+
jobs:
18+
claude-code-action:
19+
if: |
20+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
21+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
22+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
23+
(github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
24+
runs-on: ubuntu-latest
25+
permissions:
26+
contents: read
27+
pull-requests: read
28+
issues: read
29+
id-token: write
30+
actions: read
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 1
36+
37+
- uses: astral-sh/setup-uv@v5
38+
with:
39+
enable-cache: true
40+
41+
- uses: denoland/setup-deno@v2
42+
with:
43+
deno-version: v2.x
44+
45+
- run: uv tool install pre-commit
46+
47+
- run: make install
48+
49+
- name: Run Claude PR Action
50+
uses: anthropics/claude-code-action@beta
51+
with:
52+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
53+
timeout_minutes: "60"
54+
additional_permissions: |
55+
actions: read
56+
allowed_tools: |
57+
Bash(make:*)
58+
Bash(uv:*)

docs/ag-ui.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,15 @@ The adapter provides full support for
8282
real-time synchronization between agents and frontend applications.
8383

8484
In the example below we have document state which is shared between the UI and
85-
server using the [`StateDeps`][pydantic_ai.ag_ui.StateDeps] which implements the
86-
[`StateHandler`][pydantic_ai.ag_ui.StateHandler] protocol that can be used to automatically
87-
decode state contained in [`RunAgentInput.state`](https://docs.ag-ui.com/sdk/js/core/types#runagentinput)
88-
when processing requests.
85+
server using the [`StateDeps`][pydantic_ai.ag_ui.StateDeps] [dependencies type](./dependencies.md) that can be used to automatically
86+
validate state contained in [`RunAgentInput.state`](https://docs.ag-ui.com/sdk/js/core/types#runagentinput) using a Pydantic `BaseModel` specified as a generic parameter.
87+
88+
!!! note "Custom dependencies type with AG-UI state"
89+
If you want to use your own dependencies type to hold AG-UI state as well as other things, it needs to implements the
90+
[`StateHandler`][pydantic_ai.ag_ui.StateHandler] protocol, meaning it needs to be a [dataclass](https://docs.python.org/3/library/dataclasses.html) with a non-optional `state` field. This lets Pydantic AI ensure that state is properly isolated between requests by building a new dependencies object each time.
91+
92+
If the `state` field's type is a Pydantic `BaseModel` subclass, the raw state dictionary on the request is automatically validated. If not, you can validate the raw value yourself in your dependencies dataclass's `__post_init__` method.
93+
8994

9095
```python {title="ag_ui_state.py" py="3.10"}
9196
from pydantic import BaseModel

docs/api/retries.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# `pydantic_ai.retries`
2+
3+
::: pydantic_ai.retries

0 commit comments

Comments
 (0)