From 171b1145ee58bfb2f6d654e8f022e43ff2d1a392 Mon Sep 17 00:00:00 2001 From: Hangfei Lin Date: Mon, 19 May 2025 11:01:30 -0700 Subject: [PATCH] fix:Makes TranscriptionEntry.role optional For function call or response, the role is None for now. PiperOrigin-RevId: 760692876 --- src/google/adk/agents/transcription_entry.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/google/adk/agents/transcription_entry.py b/src/google/adk/agents/transcription_entry.py index c59ad88..a44467a 100644 --- a/src/google/adk/agents/transcription_entry.py +++ b/src/google/adk/agents/transcription_entry.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import Optional from typing import Union from google.genai import types @@ -28,8 +29,9 @@ class TranscriptionEntry(BaseModel): ) """The pydantic model config.""" - role: str - """The role that created this data, typically "user" or "model""" + role: Optional[str] = None + """The role that created this data, typically "user" or "model". For function + call, this is None.""" data: Union[types.Blob, types.Content] """The data that can be used for transcription"""