diff --git a/src/google/adk/agents/active_streaming_tool.py b/src/google/adk/agents/active_streaming_tool.py index e5499e0..db0a764 100644 --- a/src/google/adk/agents/active_streaming_tool.py +++ b/src/google/adk/agents/active_streaming_tool.py @@ -30,6 +30,7 @@ class ActiveStreamingTool(BaseModel): arbitrary_types_allowed=True, extra='forbid', ) + """The pydantic model config.""" task: Optional[asyncio.Task] = None """The active task of this streaming tool.""" diff --git a/src/google/adk/agents/base_agent.py b/src/google/adk/agents/base_agent.py index 764fedb..067e1aa 100644 --- a/src/google/adk/agents/base_agent.py +++ b/src/google/adk/agents/base_agent.py @@ -50,6 +50,7 @@ class BaseAgent(BaseModel): arbitrary_types_allowed=True, extra='forbid', ) + """The pydantic model config.""" name: str """The agent's name. diff --git a/src/google/adk/agents/invocation_context.py b/src/google/adk/agents/invocation_context.py index 9acee44..46ec663 100644 --- a/src/google/adk/agents/invocation_context.py +++ b/src/google/adk/agents/invocation_context.py @@ -110,6 +110,7 @@ class InvocationContext(BaseModel): arbitrary_types_allowed=True, extra="forbid", ) + """The pydantic model config.""" artifact_service: Optional[BaseArtifactService] = None session_service: BaseSessionService diff --git a/src/google/adk/agents/langgraph_agent.py b/src/google/adk/agents/langgraph_agent.py index 33a21b4..f07b203 100644 --- a/src/google/adk/agents/langgraph_agent.py +++ b/src/google/adk/agents/langgraph_agent.py @@ -53,6 +53,7 @@ class LangGraphAgent(BaseAgent): model_config = ConfigDict( arbitrary_types_allowed=True, ) + """The pydantic model config.""" graph: CompiledGraph diff --git a/src/google/adk/agents/live_request_queue.py b/src/google/adk/agents/live_request_queue.py index 3caf725..837750e 100644 --- a/src/google/adk/agents/live_request_queue.py +++ b/src/google/adk/agents/live_request_queue.py @@ -24,6 +24,7 @@ class LiveRequest(BaseModel): """Request send to live agents.""" model_config = ConfigDict(ser_json_bytes='base64', val_json_bytes='base64') + """The pydantic model config.""" content: Optional[types.Content] = None """If set, send the content to the model in turn-by-turn mode.""" diff --git a/src/google/adk/agents/run_config.py b/src/google/adk/agents/run_config.py index 17dff29..e121750 100644 --- a/src/google/adk/agents/run_config.py +++ b/src/google/adk/agents/run_config.py @@ -37,6 +37,7 @@ class RunConfig(BaseModel): model_config = ConfigDict( extra='forbid', ) + """The pydantic model config.""" speech_config: Optional[types.SpeechConfig] = None """Speech configuration for the live agent.""" diff --git a/src/google/adk/agents/transcription_entry.py b/src/google/adk/agents/transcription_entry.py index f415e7c..c59ad88 100644 --- a/src/google/adk/agents/transcription_entry.py +++ b/src/google/adk/agents/transcription_entry.py @@ -26,6 +26,7 @@ class TranscriptionEntry(BaseModel): arbitrary_types_allowed=True, extra='forbid', ) + """The pydantic model config.""" role: str """The role that created this data, typically "user" or "model""" diff --git a/src/google/adk/auth/auth_credential.py b/src/google/adk/auth/auth_credential.py index 90fbbee..ed2ec48 100644 --- a/src/google/adk/auth/auth_credential.py +++ b/src/google/adk/auth/auth_credential.py @@ -13,17 +13,16 @@ # limitations under the License. from enum import Enum -from typing import Any -from typing import Dict -from typing import List -from typing import Optional +from typing import Any, Dict, List, Optional from pydantic import BaseModel +from pydantic import ConfigDict from pydantic import Field class BaseModelWithConfig(BaseModel): - model_config = {"extra": "allow"} + model_config = ConfigDict(extra="allow") + """The pydantic model config.""" class HttpCredentials(BaseModelWithConfig): diff --git a/src/google/adk/events/event.py b/src/google/adk/events/event.py index c2ff07d..c36f6fc 100644 --- a/src/google/adk/events/event.py +++ b/src/google/adk/events/event.py @@ -48,6 +48,7 @@ class Event(LlmResponse): model_config = ConfigDict( extra='forbid', ser_json_bytes='base64', val_json_bytes='base64' ) + """The pydantic model config.""" # TODO: revert to be required after spark migration invocation_id: str = '' diff --git a/src/google/adk/events/event_actions.py b/src/google/adk/events/event_actions.py index f4f4078..6597edb 100644 --- a/src/google/adk/events/event_actions.py +++ b/src/google/adk/events/event_actions.py @@ -27,6 +27,7 @@ class EventActions(BaseModel): """Represents the actions attached to an event.""" model_config = ConfigDict(extra='forbid') + """The pydantic model config.""" skip_summarization: Optional[bool] = None """If true, it won't call model to summarize function response. diff --git a/src/google/adk/models/base_llm.py b/src/google/adk/models/base_llm.py index b605829..6d71cf9 100644 --- a/src/google/adk/models/base_llm.py +++ b/src/google/adk/models/base_llm.py @@ -14,11 +14,9 @@ from __future__ import annotations from abc import abstractmethod -from typing import AsyncGenerator -from typing import TYPE_CHECKING +from typing import AsyncGenerator, TYPE_CHECKING from google.genai import types - from pydantic import BaseModel from pydantic import ConfigDict @@ -34,14 +32,13 @@ class BaseLlm(BaseModel): Attributes: model: The name of the LLM, e.g. gemini-1.5-flash or gemini-1.5-flash-001. - model_config: The model config """ model_config = ConfigDict( # This allows us to use arbitrary types in the model. E.g. PIL.Image. arbitrary_types_allowed=True, ) - """The model config.""" + """The pydantic model config.""" model: str """The name of the LLM, e.g. gemini-1.5-flash or gemini-1.5-flash-001.""" diff --git a/src/google/adk/models/lite_llm.py b/src/google/adk/models/lite_llm.py index cc4184f..70e22a9 100644 --- a/src/google/adk/models/lite_llm.py +++ b/src/google/adk/models/lite_llm.py @@ -573,7 +573,6 @@ class LiteLlm(BaseLlm): Attributes: model: The name of the LiteLlm model. llm_client: The LLM client to use for the model. - model_config: The model config. """ llm_client: LiteLLMClient = Field(default_factory=LiteLLMClient) diff --git a/src/google/adk/models/llm_request.py b/src/google/adk/models/llm_request.py index cc97c55..dcb616b 100644 --- a/src/google/adk/models/llm_request.py +++ b/src/google/adk/models/llm_request.py @@ -37,7 +37,7 @@ class LlmRequest(BaseModel): """ model_config = ConfigDict(arbitrary_types_allowed=True) - """The model config.""" + """The pydantic model config.""" model: Optional[str] = None """The model name.""" diff --git a/src/google/adk/models/llm_response.py b/src/google/adk/models/llm_response.py index d7a613d..353af5d 100644 --- a/src/google/adk/models/llm_response.py +++ b/src/google/adk/models/llm_response.py @@ -41,7 +41,7 @@ class LlmResponse(BaseModel): """ model_config = ConfigDict(extra='forbid') - """The model config.""" + """The pydantic model config.""" content: Optional[types.Content] = None """The content of the response.""" diff --git a/src/google/adk/sessions/session.py b/src/google/adk/sessions/session.py index 3d3fac5..f457ce7 100644 --- a/src/google/adk/sessions/session.py +++ b/src/google/adk/sessions/session.py @@ -38,6 +38,7 @@ class Session(BaseModel): extra='forbid', arbitrary_types_allowed=True, ) + """The pydantic model config.""" id: str """The unique identifier of the session."""