Skip to content

Commit 0e173d7

Browse files
abchang123copybara-github
authored andcommitted
feat: Add camel case converter for agents
PiperOrigin-RevId: 785602954
1 parent 18f5bea commit 0e173d7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/google/adk/agents/base_agent.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
from google.genai import types
3434
from opentelemetry import trace
35+
from pydantic import alias_generators
3536
from pydantic import BaseModel
3637
from pydantic import ConfigDict
3738
from pydantic import Field
@@ -604,7 +605,11 @@ class BaseAgentConfig(BaseModel):
604605
Do not use this class directly. It's the base class for all agent configs.
605606
"""
606607

607-
model_config = ConfigDict(extra='forbid')
608+
model_config = ConfigDict(
609+
extra='forbid',
610+
alias_generator=alias_generators.to_camel,
611+
populate_by_name=True,
612+
)
608613

609614
agent_class: Literal['BaseAgent'] = 'BaseAgent'
610615
"""Required. The class of the agent. The value is used to differentiate

0 commit comments

Comments
 (0)