From c880d090195d867f7befb97ac9121642f8583cda Mon Sep 17 00:00:00 2001 From: Annie Luc Date: Mon, 26 Jan 2026 22:45:33 -0800 Subject: [PATCH] chore: Update FunctionResultContent to use TextContent PiperOrigin-RevId: 861527365 --- google/genai/_interactions/types/content_delta.py | 2 +- .../genai/_interactions/types/function_result_content.py | 3 ++- .../_interactions/types/function_result_content_param.py | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/google/genai/_interactions/types/content_delta.py b/google/genai/_interactions/types/content_delta.py index d104989ce..a608e5d27 100644 --- a/google/genai/_interactions/types/content_delta.py +++ b/google/genai/_interactions/types/content_delta.py @@ -155,7 +155,7 @@ class DeltaFunctionCallDelta(BaseModel): name: Optional[str] = None -DeltaFunctionResultDeltaResultItemsItem: TypeAlias = Union[str, ImageContent, object] +DeltaFunctionResultDeltaResultItemsItem: TypeAlias = Union[TextContent, ImageContent, object] class DeltaFunctionResultDeltaResultItems(BaseModel): diff --git a/google/genai/_interactions/types/function_result_content.py b/google/genai/_interactions/types/function_result_content.py index e8c2aa444..f5cdbc446 100644 --- a/google/genai/_interactions/types/function_result_content.py +++ b/google/genai/_interactions/types/function_result_content.py @@ -19,11 +19,12 @@ from typing_extensions import Literal, TypeAlias from .._models import BaseModel +from .text_content import TextContent from .image_content import ImageContent __all__ = ["FunctionResultContent", "Result", "ResultItems", "ResultItemsItem"] -ResultItemsItem: TypeAlias = Union[str, ImageContent, object] +ResultItemsItem: TypeAlias = Union[TextContent, ImageContent, object] class ResultItems(BaseModel): diff --git a/google/genai/_interactions/types/function_result_content_param.py b/google/genai/_interactions/types/function_result_content_param.py index 46a03e964..026d7cf00 100644 --- a/google/genai/_interactions/types/function_result_content_param.py +++ b/google/genai/_interactions/types/function_result_content_param.py @@ -17,19 +17,19 @@ from __future__ import annotations -from typing import Union +from typing import Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .._types import SequenceNotStr +from .text_content_param import TextContentParam from .image_content_param import ImageContentParam __all__ = ["FunctionResultContentParam", "Result", "ResultItems", "ResultItemsItem"] -ResultItemsItem: TypeAlias = Union[str, ImageContentParam, object] +ResultItemsItem: TypeAlias = Union[TextContentParam, ImageContentParam, object] class ResultItems(TypedDict, total=False): - items: SequenceNotStr[ResultItemsItem] + items: Iterable[ResultItemsItem] Result: TypeAlias = Union[ResultItems, str, object]