Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions google/genai/_interactions/resources/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion google/genai/_interactions/types/content_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
18 changes: 7 additions & 11 deletions google/genai/_interactions/types/function_result_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"]
Expand Down
13 changes: 3 additions & 10 deletions google/genai/_interactions/types/function_result_content_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"]]
Expand Down
6 changes: 3 additions & 3 deletions google/genai/_interactions/types/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
]

Input: TypeAlias = Union[
str,
List[Content],
str,
List[Turn],
TextContent,
ImageContent,
Expand Down Expand Up @@ -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."""
Expand Down
8 changes: 4 additions & 4 deletions google/genai/_interactions/types/interaction_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -99,8 +99,8 @@ class BaseCreateModelInteractionParams(TypedDict, total=False):


Input: TypeAlias = Union[
str,
Iterable[ContentParam],
str,
Iterable[TurnParam],
TextContentParam,
ImageContentParam,
Expand Down Expand Up @@ -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."""
Expand Down
20 changes: 8 additions & 12 deletions google/genai/_interactions/types/mcp_server_tool_result_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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"]]

Expand Down
22 changes: 11 additions & 11 deletions google/genai/_interactions/types/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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."""

Expand All @@ -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"),
]
22 changes: 11 additions & 11 deletions google/genai/_interactions/types/tool_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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."""

Expand All @@ -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]