File tree Expand file tree Collapse file tree 5 files changed +46
-6
lines changed Expand file tree Collapse file tree 5 files changed +46
-6
lines changed Original file line number Diff line number Diff line change 9
9
AServers
10
10
AService
11
11
AStarlette
12
+ AUser
12
13
EUR
13
14
GBP
15
+ GVsb
14
16
INR
15
17
JPY
16
18
JSONRPCt
29
31
datamodel
30
32
dunders
31
33
euo
34
+ excinfo
32
35
genai
33
36
getkwargs
34
37
gle
@@ -39,9 +42,11 @@ lifecycles
39
42
linting
40
43
lstrips
41
44
mockurl
45
+ notif
42
46
oauthoidc
43
47
oidc
44
48
opensource
49
+ otherurl
45
50
protoc
46
51
pyi
47
52
pyversions
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 4
4
repository_dispatch :
5
5
types : [a2a_json_update]
6
6
workflow_dispatch :
7
+ pull_request :
8
+ branches :
9
+ - main
10
+ paths :
11
+ - " scripts/generate_types.sh"
12
+ - " src/a2a/pydantic_base.py"
13
+ types :
14
+ - opened
15
+ - synchronize
16
+ - reopened
7
17
8
18
jobs :
9
19
generate_and_pr :
15
25
steps :
16
26
- name : Checkout code
17
27
uses : actions/checkout@v4
28
+ with :
29
+ ref : ${{ github.event.pull_request.head.ref }}
30
+ repository : ${{ github.event.pull_request.head.repo.full_name }}
18
31
19
32
- name : Set up Python
20
33
uses : actions/setup-python@v5
53
66
uv run scripts/grpc_gen_post_processor.py
54
67
echo "Buf generate finished."
55
68
56
- - name : Create Pull Request with Updates
69
+ - name : Commit changes to current PR
70
+ if : github.event_name == 'pull_request' # Only run this step for pull_request events
71
+ run : |
72
+ git config user.name "a2a-bot"
73
+ git config user.email "[email protected] "
74
+ git add ${{ steps.vars.outputs.GENERATED_FILE }} src/a2a/grpc/
75
+ git diff --cached --exit-code || git commit -m "feat: Update A2A types from specification 🤖"
76
+ git push
77
+ env :
78
+ GITHUB_TOKEN : ${{ secrets.A2A_BOT_PAT }}
79
+
80
+ - name : Create Pull Request with Updates (for repository_dispatch/workflow_dispatch)
81
+ if : github.event_name != 'pull_request'
57
82
uses : peter-evans/create-pull-request@v6
58
83
with :
59
84
token : ${{ secrets.A2A_BOT_PAT }}
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ uv run datamodel-codegen \
23
23
--output " $GENERATED_FILE " \
24
24
--target-python-version 3.10 \
25
25
--output-model-type pydantic_v2.BaseModel \
26
+ --base-class a2a.pydantic_base.A2ABaseModel \
26
27
--disable-timestamp \
27
28
--use-schema-description \
28
29
--use-union-operator \
Original file line number Diff line number Diff line change
1
+ """A2A Pydantic Base Model with shared configuration."""
2
+
3
+ from pydantic import BaseModel , ConfigDict
4
+ from pydantic .alias_generators import to_snake
5
+
6
+
7
+ class A2ABaseModel (BaseModel ):
8
+ """Base model for all A2A types with shared configuration."""
9
+
10
+ model_config = ConfigDict (
11
+ alias_generator = to_snake ,
12
+ populate_by_name = True ,
13
+ arbitrary_types_allowed = True ,
14
+ )
You can’t perform that action at this time.
0 commit comments