Skip to content

Commit dbea793

Browse files
Jacksunweicopybara-github
authored andcommitted
chore: Updates model_config docstring to explicitly mentioning pydantic.
This is to disambiguate between pydantic model and LLM. PiperOrigin-RevId: 754981617
1 parent a930633 commit dbea793

15 files changed

Lines changed: 18 additions & 13 deletions

‎src/google/adk/agents/active_streaming_tool.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ActiveStreamingTool(BaseModel):
3030
arbitrary_types_allowed=True,
3131
extra='forbid',
3232
)
33+
"""The pydantic model config."""
3334

3435
task: Optional[asyncio.Task] = None
3536
"""The active task of this streaming tool."""

‎src/google/adk/agents/base_agent.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class BaseAgent(BaseModel):
5050
arbitrary_types_allowed=True,
5151
extra='forbid',
5252
)
53+
"""The pydantic model config."""
5354

5455
name: str
5556
"""The agent's name.

‎src/google/adk/agents/invocation_context.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class InvocationContext(BaseModel):
110110
arbitrary_types_allowed=True,
111111
extra="forbid",
112112
)
113+
"""The pydantic model config."""
113114

114115
artifact_service: Optional[BaseArtifactService] = None
115116
session_service: BaseSessionService

‎src/google/adk/agents/langgraph_agent.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class LangGraphAgent(BaseAgent):
5353
model_config = ConfigDict(
5454
arbitrary_types_allowed=True,
5555
)
56+
"""The pydantic model config."""
5657

5758
graph: CompiledGraph
5859

‎src/google/adk/agents/live_request_queue.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class LiveRequest(BaseModel):
2424
"""Request send to live agents."""
2525

2626
model_config = ConfigDict(ser_json_bytes='base64', val_json_bytes='base64')
27+
"""The pydantic model config."""
2728

2829
content: Optional[types.Content] = None
2930
"""If set, send the content to the model in turn-by-turn mode."""

‎src/google/adk/agents/run_config.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class RunConfig(BaseModel):
3737
model_config = ConfigDict(
3838
extra='forbid',
3939
)
40+
"""The pydantic model config."""
4041

4142
speech_config: Optional[types.SpeechConfig] = None
4243
"""Speech configuration for the live agent."""

‎src/google/adk/agents/transcription_entry.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class TranscriptionEntry(BaseModel):
2626
arbitrary_types_allowed=True,
2727
extra='forbid',
2828
)
29+
"""The pydantic model config."""
2930

3031
role: str
3132
"""The role that created this data, typically "user" or "model"""

‎src/google/adk/auth/auth_credential.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313
# limitations under the License.
1414

1515
from enum import Enum
16-
from typing import Any
17-
from typing import Dict
18-
from typing import List
19-
from typing import Optional
16+
from typing import Any, Dict, List, Optional
2017

2118
from pydantic import BaseModel
19+
from pydantic import ConfigDict
2220
from pydantic import Field
2321

2422

2523
class BaseModelWithConfig(BaseModel):
26-
model_config = {"extra": "allow"}
24+
model_config = ConfigDict(extra="allow")
25+
"""The pydantic model config."""
2726

2827

2928
class HttpCredentials(BaseModelWithConfig):

‎src/google/adk/events/event.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class Event(LlmResponse):
4848
model_config = ConfigDict(
4949
extra='forbid', ser_json_bytes='base64', val_json_bytes='base64'
5050
)
51+
"""The pydantic model config."""
5152

5253
# TODO: revert to be required after spark migration
5354
invocation_id: str = ''

‎src/google/adk/events/event_actions.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class EventActions(BaseModel):
2727
"""Represents the actions attached to an event."""
2828

2929
model_config = ConfigDict(extra='forbid')
30+
"""The pydantic model config."""
3031

3132
skip_summarization: Optional[bool] = None
3233
"""If true, it won't call model to summarize function response.

0 commit comments

Comments
 (0)