diff --git a/google/genai/_interactions/_compat.py b/google/genai/_interactions/_compat.py index 25b3af666..d00a0df9c 100644 --- a/google/genai/_interactions/_compat.py +++ b/google/genai/_interactions/_compat.py @@ -17,7 +17,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self, Literal +from typing_extensions import Self, Literal, TypedDict import pydantic from pydantic.fields import FieldInfo @@ -146,6 +146,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: return model.model_dump_json(indent=indent) +class _ModelDumpKwargs(TypedDict, total=False): + by_alias: bool + + def model_dump( model: pydantic.BaseModel, *, @@ -157,6 +161,9 @@ def model_dump( by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): + kwargs: _ModelDumpKwargs = {} + if by_alias is not None: + kwargs["by_alias"] = by_alias return model.model_dump( mode=mode, exclude=exclude, @@ -164,7 +171,7 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, - by_alias=by_alias, + **kwargs, ) return cast( "dict[str, Any]", diff --git a/google/genai/_interactions/types/content.py b/google/genai/_interactions/types/content.py index b25c11e29..414524101 100644 --- a/google/genai/_interactions/types/content.py +++ b/google/genai/_interactions/types/content.py @@ -51,18 +51,18 @@ VideoContent, ThoughtContent, FunctionCallContent, - FunctionResultContent, CodeExecutionCallContent, - CodeExecutionResultContent, URLContextCallContent, - URLContextResultContent, + MCPServerToolCallContent, GoogleSearchCallContent, + FileSearchCallContent, + GoogleMapsCallContent, + FunctionResultContent, + CodeExecutionResultContent, + URLContextResultContent, GoogleSearchResultContent, - MCPServerToolCallContent, MCPServerToolResultContent, - FileSearchCallContent, FileSearchResultContent, - GoogleMapsCallContent, GoogleMapsResultContent, ], PropertyInfo(discriminator="type"), diff --git a/google/genai/_interactions/types/content_delta.py b/google/genai/_interactions/types/content_delta.py index 30850b47f..8379e4614 100644 --- a/google/genai/_interactions/types/content_delta.py +++ b/google/genai/_interactions/types/content_delta.py @@ -43,24 +43,20 @@ "DeltaThoughtSummaryContent", "DeltaThoughtSignature", "DeltaFunctionCall", - "DeltaFunctionResult", - "DeltaFunctionResultResult", - "DeltaFunctionResultResultItems", - "DeltaFunctionResultResultItemsItem", "DeltaCodeExecutionCall", - "DeltaCodeExecutionResult", "DeltaURLContextCall", - "DeltaURLContextResult", "DeltaGoogleSearchCall", - "DeltaGoogleSearchResult", "DeltaMCPServerToolCall", - "DeltaMCPServerToolResult", - "DeltaMCPServerToolResultResult", - "DeltaMCPServerToolResultResultItems", - "DeltaMCPServerToolResultResultItemsItem", "DeltaFileSearchCall", - "DeltaFileSearchResult", "DeltaGoogleMapsCall", + "DeltaFunctionResult", + "DeltaFunctionResultResultFunctionResultSubcontentList", + "DeltaCodeExecutionResult", + "DeltaURLContextResult", + "DeltaGoogleSearchResult", + "DeltaMCPServerToolResult", + "DeltaMCPServerToolResultResultFunctionResultSubcontentList", + "DeltaFileSearchResult", "DeltaGoogleMapsResult", ] @@ -163,107 +159,126 @@ class DeltaFunctionCall(BaseModel): """A signature hash for backend validation.""" -DeltaFunctionResultResultItemsItem: TypeAlias = Union[TextContent, ImageContent] +class DeltaCodeExecutionCall(BaseModel): + id: str + """A unique ID for this specific tool call.""" + arguments: CodeExecutionCallArguments + """The arguments to pass to the code execution.""" -class DeltaFunctionResultResultItems(BaseModel): - items: Optional[List[DeltaFunctionResultResultItemsItem]] = None + type: Literal["code_execution_call"] + signature: Optional[str] = None + """A signature hash for backend validation.""" -DeltaFunctionResultResult: TypeAlias = Union[DeltaFunctionResultResultItems, str, object] +class DeltaURLContextCall(BaseModel): + id: str + """A unique ID for this specific tool call.""" -class DeltaFunctionResult(BaseModel): - call_id: str - """ID to match the ID from the function call block.""" + arguments: URLContextCallArguments + """The arguments to pass to the URL context.""" - result: DeltaFunctionResultResult - """Tool call result delta.""" + type: Literal["url_context_call"] - type: Literal["function_result"] + signature: Optional[str] = None + """A signature hash for backend validation.""" - is_error: Optional[bool] = None - name: Optional[str] = None +class DeltaGoogleSearchCall(BaseModel): + id: str + """A unique ID for this specific tool call.""" + + arguments: GoogleSearchCallArguments + """The arguments to pass to Google Search.""" + + type: Literal["google_search_call"] signature: Optional[str] = None """A signature hash for backend validation.""" -class DeltaCodeExecutionCall(BaseModel): +class DeltaMCPServerToolCall(BaseModel): id: str """A unique ID for this specific tool call.""" - arguments: CodeExecutionCallArguments - """The arguments to pass to the code execution.""" + arguments: Dict[str, object] - type: Literal["code_execution_call"] + name: str - signature: Optional[str] = None - """A signature hash for backend validation.""" + server_name: str + type: Literal["mcp_server_tool_call"] -class DeltaCodeExecutionResult(BaseModel): - call_id: str - """ID to match the ID from the function call block.""" + signature: Optional[str] = None + """A signature hash for backend validation.""" - result: str - type: Literal["code_execution_result"] +class DeltaFileSearchCall(BaseModel): + id: str + """A unique ID for this specific tool call.""" - is_error: Optional[bool] = None + type: Literal["file_search_call"] signature: Optional[str] = None """A signature hash for backend validation.""" -class DeltaURLContextCall(BaseModel): +class DeltaGoogleMapsCall(BaseModel): id: str """A unique ID for this specific tool call.""" - arguments: URLContextCallArguments - """The arguments to pass to the URL context.""" + type: Literal["google_maps_call"] - type: Literal["url_context_call"] + arguments: Optional[GoogleMapsCallArguments] = None + """The arguments to pass to the Google Maps tool.""" signature: Optional[str] = None """A signature hash for backend validation.""" -class DeltaURLContextResult(BaseModel): +DeltaFunctionResultResultFunctionResultSubcontentList: TypeAlias = Annotated[ + Union[TextContent, ImageContent], PropertyInfo(discriminator="type") +] + + +class DeltaFunctionResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" - result: List[URLContextResult] + result: Union[List[DeltaFunctionResultResultFunctionResultSubcontentList], str, object] - type: Literal["url_context_result"] + type: Literal["function_result"] is_error: Optional[bool] = None + name: Optional[str] = None + signature: Optional[str] = None """A signature hash for backend validation.""" -class DeltaGoogleSearchCall(BaseModel): - id: str - """A unique ID for this specific tool call.""" +class DeltaCodeExecutionResult(BaseModel): + call_id: str + """ID to match the ID from the function call block.""" - arguments: GoogleSearchCallArguments - """The arguments to pass to Google Search.""" + result: str - type: Literal["google_search_call"] + type: Literal["code_execution_result"] + + is_error: Optional[bool] = None signature: Optional[str] = None """A signature hash for backend validation.""" -class DeltaGoogleSearchResult(BaseModel): +class DeltaURLContextResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" - result: List[GoogleSearchResult] + result: List[URLContextResult] - type: Literal["google_search_result"] + type: Literal["url_context_result"] is_error: Optional[bool] = None @@ -271,38 +286,30 @@ class DeltaGoogleSearchResult(BaseModel): """A signature hash for backend validation.""" -class DeltaMCPServerToolCall(BaseModel): - id: str - """A unique ID for this specific tool call.""" - - arguments: Dict[str, object] +class DeltaGoogleSearchResult(BaseModel): + call_id: str + """ID to match the ID from the function call block.""" - name: str + result: List[GoogleSearchResult] - server_name: str + type: Literal["google_search_result"] - type: Literal["mcp_server_tool_call"] + is_error: Optional[bool] = None signature: Optional[str] = None """A signature hash for backend validation.""" -DeltaMCPServerToolResultResultItemsItem: TypeAlias = Union[TextContent, ImageContent] - - -class DeltaMCPServerToolResultResultItems(BaseModel): - items: Optional[List[DeltaMCPServerToolResultResultItemsItem]] = None - - -DeltaMCPServerToolResultResult: TypeAlias = Union[DeltaMCPServerToolResultResultItems, str, object] +DeltaMCPServerToolResultResultFunctionResultSubcontentList: TypeAlias = Annotated[ + Union[TextContent, ImageContent], PropertyInfo(discriminator="type") +] class DeltaMCPServerToolResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" - result: DeltaMCPServerToolResultResult - """Tool call result delta.""" + result: Union[List[DeltaMCPServerToolResultResultFunctionResultSubcontentList], str, object] type: Literal["mcp_server_tool_result"] @@ -314,16 +321,6 @@ class DeltaMCPServerToolResult(BaseModel): """A signature hash for backend validation.""" -class DeltaFileSearchCall(BaseModel): - id: str - """A unique ID for this specific tool call.""" - - type: Literal["file_search_call"] - - signature: Optional[str] = None - """A signature hash for backend validation.""" - - class DeltaFileSearchResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" @@ -336,19 +333,6 @@ class DeltaFileSearchResult(BaseModel): """A signature hash for backend validation.""" -class DeltaGoogleMapsCall(BaseModel): - id: str - """A unique ID for this specific tool call.""" - - type: Literal["google_maps_call"] - - arguments: Optional[GoogleMapsCallArguments] = None - """The arguments to pass to the Google Maps tool.""" - - signature: Optional[str] = None - """A signature hash for backend validation.""" - - class DeltaGoogleMapsResult(BaseModel): call_id: str """ID to match the ID from the function call block.""" @@ -372,18 +356,18 @@ class DeltaGoogleMapsResult(BaseModel): DeltaThoughtSummary, DeltaThoughtSignature, DeltaFunctionCall, - DeltaFunctionResult, DeltaCodeExecutionCall, - DeltaCodeExecutionResult, DeltaURLContextCall, - DeltaURLContextResult, DeltaGoogleSearchCall, - DeltaGoogleSearchResult, DeltaMCPServerToolCall, - DeltaMCPServerToolResult, DeltaFileSearchCall, - DeltaFileSearchResult, DeltaGoogleMapsCall, + DeltaFunctionResult, + DeltaCodeExecutionResult, + DeltaURLContextResult, + DeltaGoogleSearchResult, + DeltaMCPServerToolResult, + DeltaFileSearchResult, DeltaGoogleMapsResult, ], PropertyInfo(discriminator="type"), @@ -392,6 +376,7 @@ class DeltaGoogleMapsResult(BaseModel): class ContentDelta(BaseModel): delta: Delta + """The delta content data for a content block.""" event_type: Literal["content.delta"] @@ -399,5 +384,6 @@ class ContentDelta(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/content_param.py b/google/genai/_interactions/types/content_param.py index 113933f83..34b864a33 100644 --- a/google/genai/_interactions/types/content_param.py +++ b/google/genai/_interactions/types/content_param.py @@ -51,17 +51,17 @@ VideoContentParam, ThoughtContentParam, FunctionCallContentParam, - FunctionResultContentParam, CodeExecutionCallContentParam, - CodeExecutionResultContentParam, URLContextCallContentParam, - URLContextResultContentParam, + MCPServerToolCallContentParam, GoogleSearchCallContentParam, + FileSearchCallContentParam, + GoogleMapsCallContentParam, + FunctionResultContentParam, + CodeExecutionResultContentParam, + URLContextResultContentParam, GoogleSearchResultContentParam, - MCPServerToolCallContentParam, MCPServerToolResultContentParam, - FileSearchCallContentParam, FileSearchResultContentParam, - GoogleMapsCallContentParam, GoogleMapsResultContentParam, ] diff --git a/google/genai/_interactions/types/content_start.py b/google/genai/_interactions/types/content_start.py index 1431cb1eb..31688b7bd 100644 --- a/google/genai/_interactions/types/content_start.py +++ b/google/genai/_interactions/types/content_start.py @@ -34,5 +34,6 @@ class ContentStart(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/content_stop.py b/google/genai/_interactions/types/content_stop.py index 578c1f2c9..d564cb7ec 100644 --- a/google/genai/_interactions/types/content_stop.py +++ b/google/genai/_interactions/types/content_stop.py @@ -30,5 +30,6 @@ class ContentStop(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/error_event.py b/google/genai/_interactions/types/error_event.py index 8abf8ca3e..e109de7f6 100644 --- a/google/genai/_interactions/types/error_event.py +++ b/google/genai/_interactions/types/error_event.py @@ -41,5 +41,6 @@ class ErrorEvent(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/file_citation.py b/google/genai/_interactions/types/file_citation.py index 6fa247093..d6f760505 100644 --- a/google/genai/_interactions/types/file_citation.py +++ b/google/genai/_interactions/types/file_citation.py @@ -41,4 +41,7 @@ class FileCitation(BaseModel): """Source attributed for a portion of the text.""" start_index: Optional[int] = None - """Start of segment of the response that is attributed to this source.""" + """Start of segment of the response that is attributed to this source. + + Index indicates the start of the segment, measured in bytes. + """ diff --git a/google/genai/_interactions/types/file_citation_param.py b/google/genai/_interactions/types/file_citation_param.py index 5f4843d75..e7ccff934 100644 --- a/google/genai/_interactions/types/file_citation_param.py +++ b/google/genai/_interactions/types/file_citation_param.py @@ -40,4 +40,7 @@ class FileCitationParam(TypedDict, total=False): """Source attributed for a portion of the text.""" start_index: int - """Start of segment of the response that is attributed to this source.""" + """Start of segment of the response that is attributed to this source. + + Index indicates the start of the segment, measured in bytes. + """ diff --git a/google/genai/_interactions/types/generation_config.py b/google/genai/_interactions/types/generation_config.py index 4972faba0..cf2b99c9a 100644 --- a/google/genai/_interactions/types/generation_config.py +++ b/google/genai/_interactions/types/generation_config.py @@ -58,7 +58,7 @@ class GenerationConfig(BaseModel): """Whether to include thought summaries in the response.""" tool_choice: Optional[ToolChoice] = None - """The tool choice for the interaction.""" + """The tool choice configuration.""" top_p: Optional[float] = None """The maximum cumulative probability of tokens to consider when sampling.""" diff --git a/google/genai/_interactions/types/generation_config_param.py b/google/genai/_interactions/types/generation_config_param.py index a18ac8798..286df7766 100644 --- a/google/genai/_interactions/types/generation_config_param.py +++ b/google/genai/_interactions/types/generation_config_param.py @@ -60,7 +60,7 @@ class GenerationConfigParam(TypedDict, total=False): """Whether to include thought summaries in the response.""" tool_choice: ToolChoice - """The tool choice for the interaction.""" + """The tool choice configuration.""" top_p: float """The maximum cumulative probability of tokens to consider when sampling.""" diff --git a/google/genai/_interactions/types/interaction.py b/google/genai/_interactions/types/interaction.py index 0885908ac..f0bbf9a0f 100644 --- a/google/genai/_interactions/types/interaction.py +++ b/google/genai/_interactions/types/interaction.py @@ -66,18 +66,18 @@ VideoContent, ThoughtContent, FunctionCallContent, - FunctionResultContent, CodeExecutionCallContent, - CodeExecutionResultContent, URLContextCallContent, - URLContextResultContent, + MCPServerToolCallContent, GoogleSearchCallContent, + FileSearchCallContent, + GoogleMapsCallContent, + FunctionResultContent, + CodeExecutionResultContent, + URLContextResultContent, GoogleSearchResultContent, - MCPServerToolCallContent, MCPServerToolResultContent, - FileSearchCallContent, FileSearchResultContent, - GoogleMapsCallContent, GoogleMapsResultContent, ] diff --git a/google/genai/_interactions/types/interaction_complete_event.py b/google/genai/_interactions/types/interaction_complete_event.py index b45a642f5..7b537a588 100644 --- a/google/genai/_interactions/types/interaction_complete_event.py +++ b/google/genai/_interactions/types/interaction_complete_event.py @@ -35,5 +35,6 @@ class InteractionCompleteEvent(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/interaction_create_params.py b/google/genai/_interactions/types/interaction_create_params.py index aebf09847..4a6610323 100644 --- a/google/genai/_interactions/types/interaction_create_params.py +++ b/google/genai/_interactions/types/interaction_create_params.py @@ -111,18 +111,18 @@ class BaseCreateModelInteractionParams(TypedDict, total=False): VideoContentParam, ThoughtContentParam, FunctionCallContentParam, - FunctionResultContentParam, CodeExecutionCallContentParam, - CodeExecutionResultContentParam, URLContextCallContentParam, - URLContextResultContentParam, + MCPServerToolCallContentParam, GoogleSearchCallContentParam, + FileSearchCallContentParam, + GoogleMapsCallContentParam, + FunctionResultContentParam, + CodeExecutionResultContentParam, + URLContextResultContentParam, GoogleSearchResultContentParam, - MCPServerToolCallContentParam, MCPServerToolResultContentParam, - FileSearchCallContentParam, FileSearchResultContentParam, - GoogleMapsCallContentParam, GoogleMapsResultContentParam, ] diff --git a/google/genai/_interactions/types/interaction_start_event.py b/google/genai/_interactions/types/interaction_start_event.py index 1202ec849..6bca76557 100644 --- a/google/genai/_interactions/types/interaction_start_event.py +++ b/google/genai/_interactions/types/interaction_start_event.py @@ -32,5 +32,6 @@ class InteractionStartEvent(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/interaction_status_update.py b/google/genai/_interactions/types/interaction_status_update.py index b4c571ab3..aca983c58 100644 --- a/google/genai/_interactions/types/interaction_status_update.py +++ b/google/genai/_interactions/types/interaction_status_update.py @@ -32,5 +32,6 @@ class InteractionStatusUpdate(BaseModel): event_id: Optional[str] = None """ - The event_id token to be used to resume the interaction stream, from this event. + The event_id token to be used to resume the interaction stream, from + this event. """ diff --git a/google/genai/_interactions/types/place_citation.py b/google/genai/_interactions/types/place_citation.py index 21e52636b..fbe6072a5 100644 --- a/google/genai/_interactions/types/place_citation.py +++ b/google/genai/_interactions/types/place_citation.py @@ -60,7 +60,10 @@ class PlaceCitation(BaseModel): """ start_index: Optional[int] = None - """Start of segment of the response that is attributed to this source.""" + """Start of segment of the response that is attributed to this source. + + Index indicates the start of the segment, measured in bytes. + """ url: Optional[str] = None """URI reference of the place.""" diff --git a/google/genai/_interactions/types/place_citation_param.py b/google/genai/_interactions/types/place_citation_param.py index 498b4d9a8..162a78271 100644 --- a/google/genai/_interactions/types/place_citation_param.py +++ b/google/genai/_interactions/types/place_citation_param.py @@ -60,7 +60,10 @@ class PlaceCitationParam(TypedDict, total=False): """ start_index: int - """Start of segment of the response that is attributed to this source.""" + """Start of segment of the response that is attributed to this source. + + Index indicates the start of the segment, measured in bytes. + """ url: str """URI reference of the place.""" diff --git a/google/genai/_interactions/types/tool.py b/google/genai/_interactions/types/tool.py index 3ef06a37d..4e1d1a623 100644 --- a/google/genai/_interactions/types/tool.py +++ b/google/genai/_interactions/types/tool.py @@ -27,25 +27,16 @@ __all__ = [ "Tool", - "GoogleSearch", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", + "GoogleSearch", "FileSearch", "GoogleMaps", ] -class GoogleSearch(BaseModel): - """A tool that can be used by the model to search Google.""" - - type: Literal["google_search"] - - search_types: Optional[List[Literal["web_search", "image_search"]]] = None - """The types of search grounding to enable.""" - - class CodeExecution(BaseModel): """A tool that can be used by the model to execute code.""" @@ -91,6 +82,15 @@ class MCPServer(BaseModel): """ +class GoogleSearch(BaseModel): + """A tool that can be used by the model to search Google.""" + + type: Literal["google_search"] + + search_types: Optional[List[Literal["web_search", "image_search"]]] = None + """The types of search grounding to enable.""" + + class FileSearch(BaseModel): """A tool that can be used by the model to search files.""" @@ -125,6 +125,6 @@ class GoogleMaps(BaseModel): Tool: TypeAlias = Annotated[ - Union[Function, GoogleSearch, CodeExecution, URLContext, ComputerUse, MCPServer, FileSearch, GoogleMaps], + Union[Function, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch, GoogleMaps], PropertyInfo(discriminator="type"), ] diff --git a/google/genai/_interactions/types/tool_param.py b/google/genai/_interactions/types/tool_param.py index ec01bc2b3..5a00955a8 100644 --- a/google/genai/_interactions/types/tool_param.py +++ b/google/genai/_interactions/types/tool_param.py @@ -27,25 +27,16 @@ __all__ = [ "ToolParam", - "GoogleSearch", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", + "GoogleSearch", "FileSearch", "GoogleMaps", ] -class GoogleSearch(TypedDict, total=False): - """A tool that can be used by the model to search Google.""" - - type: Required[Literal["google_search"]] - - search_types: List[Literal["web_search", "image_search"]] - """The types of search grounding to enable.""" - - class CodeExecution(TypedDict, total=False): """A tool that can be used by the model to execute code.""" @@ -91,6 +82,15 @@ class MCPServer(TypedDict, total=False): """ +class GoogleSearch(TypedDict, total=False): + """A tool that can be used by the model to search Google.""" + + type: Required[Literal["google_search"]] + + search_types: List[Literal["web_search", "image_search"]] + """The types of search grounding to enable.""" + + class FileSearch(TypedDict, total=False): """A tool that can be used by the model to search files.""" @@ -125,5 +125,5 @@ class GoogleMaps(TypedDict, total=False): ToolParam: TypeAlias = Union[ - FunctionParam, GoogleSearch, CodeExecution, URLContext, ComputerUse, MCPServer, FileSearch, GoogleMaps + FunctionParam, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch, GoogleMaps ] diff --git a/google/genai/_interactions/types/turn.py b/google/genai/_interactions/types/turn.py index b769c7686..b7be1b25f 100644 --- a/google/genai/_interactions/types/turn.py +++ b/google/genai/_interactions/types/turn.py @@ -24,8 +24,7 @@ class Turn(BaseModel): - content: Union[str, List[Content], None] = None - """The content of the turn.""" + content: Union[List[Content], str, None] = None role: Optional[str] = None """The originator of this turn. diff --git a/google/genai/_interactions/types/turn_param.py b/google/genai/_interactions/types/turn_param.py index e55030db1..975b7f1ec 100644 --- a/google/genai/_interactions/types/turn_param.py +++ b/google/genai/_interactions/types/turn_param.py @@ -26,8 +26,7 @@ class TurnParam(TypedDict, total=False): - content: Union[str, Iterable[ContentParam]] - """The content of the turn.""" + content: Union[Iterable[ContentParam], str] role: str """The originator of this turn. diff --git a/google/genai/_interactions/types/url_citation.py b/google/genai/_interactions/types/url_citation.py index e1c27bffb..818ce5bf5 100644 --- a/google/genai/_interactions/types/url_citation.py +++ b/google/genai/_interactions/types/url_citation.py @@ -32,7 +32,10 @@ class URLCitation(BaseModel): """End of the attributed segment, exclusive.""" start_index: Optional[int] = None - """Start of segment of the response that is attributed to this source.""" + """Start of segment of the response that is attributed to this source. + + Index indicates the start of the segment, measured in bytes. + """ title: Optional[str] = None """The title of the URL.""" diff --git a/google/genai/_interactions/types/url_citation_param.py b/google/genai/_interactions/types/url_citation_param.py index 6df7dbcae..1f57b5736 100644 --- a/google/genai/_interactions/types/url_citation_param.py +++ b/google/genai/_interactions/types/url_citation_param.py @@ -31,7 +31,10 @@ class URLCitationParam(TypedDict, total=False): """End of the attributed segment, exclusive.""" start_index: int - """Start of segment of the response that is attributed to this source.""" + """Start of segment of the response that is attributed to this source. + + Index indicates the start of the segment, measured in bytes. + """ title: str """The title of the URL."""