chore: Migrate json field names to camelCase (3/n)

PiperOrigin-RevId: 758394880
This commit is contained in:
Google Team Member 2025-05-13 15:15:35 -07:00 committed by Copybara-Service
parent ff9de71869
commit 4def3f1bd3
2 changed files with 9 additions and 2 deletions

View File

@ -150,7 +150,7 @@ class InMemoryExporter(export.SpanExporter):
self._spans.clear()
class AgentRunRequest(BaseModel):
class AgentRunRequest(common.BaseModel):
app_name: str
user_id: str
session_id: str
@ -179,6 +179,10 @@ class RunEvalResult(common.BaseModel):
session_id: str
class GetEventGraphResult(common.BaseModel):
dot_src: str
def get_fast_api_app(
*,
agent_dir: str,
@ -804,7 +808,7 @@ def get_fast_api_app(
root_agent, [(from_name, to_name)]
)
if dot_graph and isinstance(dot_graph, graphviz.Digraph):
return {"dot_src": dot_graph.source}
return GetEventGraphResult(dot_src=dot_graph.source)
else:
return {}

View File

@ -14,6 +14,7 @@
from typing import Any
from pydantic import alias_generators
from pydantic import BaseModel
from pydantic import ConfigDict
from pydantic import Field
@ -37,6 +38,8 @@ class Session(BaseModel):
model_config = ConfigDict(
extra='forbid',
arbitrary_types_allowed=True,
alias_generator=alias_generators.to_camel,
populate_by_name=True,
)
"""The pydantic model config."""