8000 chore: Migrate json field names to camelCase (3/n) · AIGoBig/adk-python@4def3f1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4def3f1

Browse files
google-genai-botcopybara-github
authored andcommitted
chore: Migrate json field names to camelCase (3/n)
PiperOrigin-RevId: 758394880
1 parent ff9de71 commit 4def3f1

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/google/adk/cli/fast_api.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def clear(self):
150150
self._spans.clear()
151151

152152

153-
class AgentRunRequest(BaseModel):
153+
class AgentRunRequest(common.BaseModel):
154154
app_name: str
155155
user_id: str
156156
session_id: str
@@ -179,6 +179,10 @@ class RunEvalResult(common.BaseModel):
179179
session_id: str
180180

181181

182+
class GetEventGraphResult(common.BaseModel):
183+
dot_src: str
184+
185+
182186
def get_fast_api_app(
183187
*,
184188
agent_dir: str,
@@ -804,7 +808,7 @@ async def get_event_graph(
804808
root_agent, [(from_name, to_name)]
805809
)
806810
if dot_graph and isinstance(dot_graph, graphviz.Digraph):
807-
return {"dot_src": dot_graph.source}
811+
return GetEventGraphResult(dot_src=dot_graph.source)
808812
else:
809813
return {}
810814

src/google/adk/sessions/session.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from typing import Any
1616

17+
from pydantic import alias_generators
1718
from pydantic import BaseModel
1819
from pydantic import ConfigDict
1920
from pydantic import Field
@@ -37,6 +38,8 @@ class Session(BaseModel):
3738
model_config = ConfigDict(
3839
extra='forbid',
3940
arbitrary_types_allowed=True,
41+
alias_generator=alias_generators.to_camel,
42+
populate_by_name=True,
4043
)
4144
"""The pydantic model config."""
4245

0 commit comments

Comments
 (0)
0