diff --git a/google/genai/_interactions/resources/interactions.py b/google/genai/_interactions/resources/interactions.py index b0053e0f2..bae20aeb6 100644 --- a/google/genai/_interactions/resources/interactions.py +++ b/google/genai/_interactions/resources/interactions.py @@ -92,7 +92,7 @@ def create( Creates a new interaction. Args: - input: The inputs for the interaction. + input: The input for the interaction. model: The name of the `Model` used for generating the interaction. @@ -155,7 +155,7 @@ def create( Creates a new interaction. Args: - input: The inputs for the interaction. + input: The input for the interaction. model: The name of the `Model` used for generating the interaction. @@ -220,9 +220,9 @@ def create( Args: agent: The name of the `Agent` used for generating the interaction. - input: The inputs for the interaction. + input: The input for the interaction. - agent_config: Configuration for the agent. + agent_config: Configuration parameters for the agent interaction. background: Input only. Whether to run the model interaction in the background. @@ -283,11 +283,11 @@ def create( Args: agent: The name of the `Agent` used for generating the interaction. - input: The inputs for the interaction. + input: The input for the interaction. stream: Input only. Whether the interaction will be streamed. - agent_config: Configuration for the agent. + agent_config: Configuration parameters for the agent interaction. background: Input only. Whether to run the model interaction in the background. @@ -344,7 +344,7 @@ def create( Creates a new interaction. Args: - input: The inputs for the interaction. + input: The input for the interaction. model: The name of the `Model` used for generating the interaction. @@ -720,7 +720,7 @@ async def create( Creates a new interaction. Args: - input: The inputs for the interaction. + input: The input for the interaction. model: The name of the `Model` used for generating the interaction. @@ -783,7 +783,7 @@ async def create( Creates a new interaction. Args: - input: The inputs for the interaction. + input: The input for the interaction. model: The name of the `Model` used for generating the interaction. @@ -848,9 +848,9 @@ async def create( Args: agent: The name of the `Agent` used for generating the interaction. - input: The inputs for the interaction. + input: The input for the interaction. - agent_config: Configuration for the agent. + agent_config: Configuration parameters for the agent interaction. background: Input only. Whether to run the model interaction in the background. @@ -911,11 +911,11 @@ async def create( Args: agent: The name of the `Agent` used for generating the interaction. - input: The inputs for the interaction. + input: The input for the interaction. stream: Input only. Whether the interaction will be streamed. - agent_config: Configuration for the agent. + agent_config: Configuration parameters for the agent interaction. background: Input only. Whether to run the model interaction in the background. @@ -972,7 +972,7 @@ async def create( Creates a new interaction. Args: - input: The inputs for the interaction. + input: The input for the interaction. model: The name of the `Model` used for generating the interaction. diff --git a/google/genai/_interactions/types/content_delta.py b/google/genai/_interactions/types/content_delta.py index 8c8865dcf..ca85483f5 100644 --- a/google/genai/_interactions/types/content_delta.py +++ b/google/genai/_interactions/types/content_delta.py @@ -138,7 +138,7 @@ class DeltaThoughtSummaryDelta(BaseModel): type: Literal["thought_summary"] content: Optional[DeltaThoughtSummaryDeltaContent] = None - """A text content block.""" + """A new summary item to be added to the thought.""" class DeltaThoughtSignatureDelta(BaseModel): diff --git a/google/genai/_interactions/types/function_result_content.py b/google/genai/_interactions/types/function_result_content.py index fa9c29015..d3b6ce5fa 100644 --- a/google/genai/_interactions/types/function_result_content.py +++ b/google/genai/_interactions/types/function_result_content.py @@ -16,22 +16,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Annotated, TypeAlias +from .._utils import PropertyInfo from .._models import BaseModel from .text_content import TextContent from .image_content import ImageContent -__all__ = ["FunctionResultContent", "Result", "ResultItems", "ResultItemsItem"] +__all__ = ["FunctionResultContent", "ResultFunctionResultSubcontentList"] -ResultItemsItem: TypeAlias = Union[TextContent, ImageContent] - - -class ResultItems(BaseModel): - items: Optional[List[ResultItemsItem]] = None - - -Result: TypeAlias = Union[ResultItems, str, object] +ResultFunctionResultSubcontentList: TypeAlias = Annotated[ + Union[TextContent, ImageContent], PropertyInfo(discriminator="type") +] class FunctionResultContent(BaseModel): @@ -40,7 +36,7 @@ class FunctionResultContent(BaseModel): call_id: str """ID to match the ID from the function call block.""" - result: Result + result: Union[List[ResultFunctionResultSubcontentList], str, object] """The result of the tool call.""" type: Literal["function_result"] diff --git a/google/genai/_interactions/types/function_result_content_param.py b/google/genai/_interactions/types/function_result_content_param.py index dca34d07d..9b277c94e 100644 --- a/google/genai/_interactions/types/function_result_content_param.py +++ b/google/genai/_interactions/types/function_result_content_param.py @@ -23,16 +23,9 @@ from .text_content_param import TextContentParam from .image_content_param import ImageContentParam -__all__ = ["FunctionResultContentParam", "Result", "ResultItems", "ResultItemsItem"] +__all__ = ["FunctionResultContentParam", "ResultFunctionResultSubcontentList"] -ResultItemsItem: TypeAlias = Union[TextContentParam, ImageContentParam] - - -class ResultItems(TypedDict, total=False): - items: Iterable[ResultItemsItem] - - -Result: TypeAlias = Union[ResultItems, str, object] +ResultFunctionResultSubcontentList: TypeAlias = Union[TextContentParam, ImageContentParam] class FunctionResultContentParam(TypedDict, total=False): @@ -41,7 +34,7 @@ class FunctionResultContentParam(TypedDict, total=False): call_id: Required[str] """ID to match the ID from the function call block.""" - result: Required[Result] + result: Required[Union[Iterable[ResultFunctionResultSubcontentList], str, object]] """The result of the tool call.""" type: Required[Literal["function_result"]] diff --git a/google/genai/_interactions/types/interaction.py b/google/genai/_interactions/types/interaction.py index 2d4a187c4..4a35a07dd 100644 --- a/google/genai/_interactions/types/interaction.py +++ b/google/genai/_interactions/types/interaction.py @@ -54,8 +54,8 @@ ] Input: TypeAlias = Union[ - str, List[Content], + str, List[Turn], TextContent, ImageContent, @@ -105,10 +105,10 @@ class Interaction(BaseModel): """The name of the `Agent` used for generating the interaction.""" agent_config: Optional[AgentConfig] = None - """Configuration for the agent.""" + """Configuration parameters for the agent interaction.""" input: Optional[Input] = None - """The inputs for the interaction.""" + """The input for the interaction.""" model: Optional[Model] = None """The name of the `Model` used for generating the interaction.""" diff --git a/google/genai/_interactions/types/interaction_create_params.py b/google/genai/_interactions/types/interaction_create_params.py index 0ce2157dc..beeede433 100644 --- a/google/genai/_interactions/types/interaction_create_params.py +++ b/google/genai/_interactions/types/interaction_create_params.py @@ -62,7 +62,7 @@ class BaseCreateModelInteractionParams(TypedDict, total=False): api_version: str input: Required[Input] - """The inputs for the interaction.""" + """The input for the interaction.""" model: Required[ModelParam] """The name of the `Model` used for generating the interaction.""" @@ -99,8 +99,8 @@ class BaseCreateModelInteractionParams(TypedDict, total=False): Input: TypeAlias = Union[ - str, Iterable[ContentParam], + str, Iterable[TurnParam], TextContentParam, ImageContentParam, @@ -130,10 +130,10 @@ class BaseCreateAgentInteractionParams(TypedDict, total=False): """The name of the `Agent` used for generating the interaction.""" input: Required[Input] - """The inputs for the interaction.""" + """The input for the interaction.""" agent_config: AgentConfig - """Configuration for the agent.""" + """Configuration parameters for the agent interaction.""" background: bool """Input only. Whether to run the model interaction in the background.""" diff --git a/google/genai/_interactions/types/mcp_server_tool_result_content.py b/google/genai/_interactions/types/mcp_server_tool_result_content.py index dafa0bd8a..329b13434 100644 --- a/google/genai/_interactions/types/mcp_server_tool_result_content.py +++ b/google/genai/_interactions/types/mcp_server_tool_result_content.py @@ -16,22 +16,18 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias +from typing_extensions import Literal, Annotated, TypeAlias +from .._utils import PropertyInfo from .._models import BaseModel from .text_content import TextContent from .image_content import ImageContent -__all__ = ["MCPServerToolResultContent", "Result", "ResultItems", "ResultItemsItem"] +__all__ = ["MCPServerToolResultContent", "ResultFunctionResultSubcontentList"] -ResultItemsItem: TypeAlias = Union[TextContent, ImageContent] - - -class ResultItems(BaseModel): - items: Optional[List[ResultItemsItem]] = None - - -Result: TypeAlias = Union[ResultItems, str, object] +ResultFunctionResultSubcontentList: TypeAlias = Annotated[ + Union[TextContent, ImageContent], PropertyInfo(discriminator="type") +] class MCPServerToolResultContent(BaseModel): @@ -40,8 +36,8 @@ class MCPServerToolResultContent(BaseModel): call_id: str """ID to match the ID from the MCP server tool call block.""" - result: Result - """The result of the tool call.""" + result: Union[List[ResultFunctionResultSubcontentList], str, object] + """The output from the MCP server call. Can be simple text or rich content.""" type: Literal["mcp_server_tool_result"] diff --git a/google/genai/_interactions/types/mcp_server_tool_result_content_param.py b/google/genai/_interactions/types/mcp_server_tool_result_content_param.py index 1f0c087d9..58b77fc1c 100644 --- a/google/genai/_interactions/types/mcp_server_tool_result_content_param.py +++ b/google/genai/_interactions/types/mcp_server_tool_result_content_param.py @@ -23,16 +23,9 @@ from .text_content_param import TextContentParam from .image_content_param import ImageContentParam -__all__ = ["MCPServerToolResultContentParam", "Result", "ResultItems", "ResultItemsItem"] +__all__ = ["MCPServerToolResultContentParam", "ResultFunctionResultSubcontentList"] -ResultItemsItem: TypeAlias = Union[TextContentParam, ImageContentParam] - - -class ResultItems(TypedDict, total=False): - items: Iterable[ResultItemsItem] - - -Result: TypeAlias = Union[ResultItems, str, object] +ResultFunctionResultSubcontentList: TypeAlias = Union[TextContentParam, ImageContentParam] class MCPServerToolResultContentParam(TypedDict, total=False): @@ -41,8 +34,8 @@ class MCPServerToolResultContentParam(TypedDict, total=False): call_id: Required[str] """ID to match the ID from the MCP server tool call block.""" - result: Required[Result] - """The result of the tool call.""" + result: Required[Union[Iterable[ResultFunctionResultSubcontentList], str, object]] + """The output from the MCP server call. Can be simple text or rich content.""" type: Required[Literal["mcp_server_tool_result"]] diff --git a/google/genai/_interactions/types/tool.py b/google/genai/_interactions/types/tool.py index d9b614706..6c70302f7 100644 --- a/google/genai/_interactions/types/tool.py +++ b/google/genai/_interactions/types/tool.py @@ -25,16 +25,7 @@ from .function import Function from .allowed_tools import AllowedTools -__all__ = ["Tool", "GoogleSearch", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "FileSearch"] - - -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.""" +__all__ = ["Tool", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "GoogleSearch", "FileSearch"] class CodeExecution(BaseModel): @@ -82,6 +73,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.""" @@ -98,6 +98,6 @@ class FileSearch(BaseModel): Tool: TypeAlias = Annotated[ - Union[Function, GoogleSearch, CodeExecution, URLContext, ComputerUse, MCPServer, FileSearch], + Union[Function, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch], PropertyInfo(discriminator="type"), ] diff --git a/google/genai/_interactions/types/tool_param.py b/google/genai/_interactions/types/tool_param.py index a9591865c..e408e7acf 100644 --- a/google/genai/_interactions/types/tool_param.py +++ b/google/genai/_interactions/types/tool_param.py @@ -25,16 +25,7 @@ from .function_param import FunctionParam from .allowed_tools_param import AllowedToolsParam -__all__ = ["ToolParam", "GoogleSearch", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "FileSearch"] - - -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.""" +__all__ = ["ToolParam", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "GoogleSearch", "FileSearch"] class CodeExecution(TypedDict, total=False): @@ -82,6 +73,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.""" @@ -97,4 +97,4 @@ class FileSearch(TypedDict, total=False): """The number of semantic retrieval chunks to retrieve.""" -ToolParam: TypeAlias = Union[FunctionParam, GoogleSearch, CodeExecution, URLContext, ComputerUse, MCPServer, FileSearch] +ToolParam: TypeAlias = Union[FunctionParam, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch]