Skip to content

Commit 2349f42

Browse files
hkt74copybara-github
authored andcommitted
chore: update comments
PiperOrigin-RevId: 881664167
1 parent 8b3be87 commit 2349f42

10 files changed

Lines changed: 66 additions & 88 deletions

google/genai/_interactions/resources/interactions.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def create(
9292
Creates a new interaction.
9393
9494
Args:
95-
input: The inputs for the interaction.
95+
input: The input for the interaction.
9696
9797
model: The name of the `Model` used for generating the interaction.
9898
@@ -155,7 +155,7 @@ def create(
155155
Creates a new interaction.
156156
157157
Args:
158-
input: The inputs for the interaction.
158+
input: The input for the interaction.
159159
160160
model: The name of the `Model` used for generating the interaction.
161161
@@ -220,9 +220,9 @@ def create(
220220
Args:
221221
agent: The name of the `Agent` used for generating the interaction.
222222
223-
input: The inputs for the interaction.
223+
input: The input for the interaction.
224224
225-
agent_config: Configuration for the agent.
225+
agent_config: Configuration parameters for the agent interaction.
226226
227227
background: Input only. Whether to run the model interaction in the background.
228228
@@ -283,11 +283,11 @@ def create(
283283
Args:
284284
agent: The name of the `Agent` used for generating the interaction.
285285
286-
input: The inputs for the interaction.
286+
input: The input for the interaction.
287287
288288
stream: Input only. Whether the interaction will be streamed.
289289
290-
agent_config: Configuration for the agent.
290+
agent_config: Configuration parameters for the agent interaction.
291291
292292
background: Input only. Whether to run the model interaction in the background.
293293
@@ -344,7 +344,7 @@ def create(
344344
Creates a new interaction.
345345
346346
Args:
347-
input: The inputs for the interaction.
347+
input: The input for the interaction.
348348
349349
model: The name of the `Model` used for generating the interaction.
350350
@@ -720,7 +720,7 @@ async def create(
720720
Creates a new interaction.
721721
722722
Args:
723-
input: The inputs for the interaction.
723+
input: The input for the interaction.
724724
725725
model: The name of the `Model` used for generating the interaction.
726726
@@ -783,7 +783,7 @@ async def create(
783783
Creates a new interaction.
784784
785785
Args:
786-
input: The inputs for the interaction.
786+
input: The input for the interaction.
787787
788788
model: The name of the `Model` used for generating the interaction.
789789
@@ -848,9 +848,9 @@ async def create(
848848
Args:
849849
agent: The name of the `Agent` used for generating the interaction.
850850
851-
input: The inputs for the interaction.
851+
input: The input for the interaction.
852852
853-
agent_config: Configuration for the agent.
853+
agent_config: Configuration parameters for the agent interaction.
854854
855855
background: Input only. Whether to run the model interaction in the background.
856856
@@ -911,11 +911,11 @@ async def create(
911911
Args:
912912
agent: The name of the `Agent` used for generating the interaction.
913913
914-
input: The inputs for the interaction.
914+
input: The input for the interaction.
915915
916916
stream: Input only. Whether the interaction will be streamed.
917917
918-
agent_config: Configuration for the agent.
918+
agent_config: Configuration parameters for the agent interaction.
919919
920920
background: Input only. Whether to run the model interaction in the background.
921921
@@ -972,7 +972,7 @@ async def create(
972972
Creates a new interaction.
973973
974974
Args:
975-
input: The inputs for the interaction.
975+
input: The input for the interaction.
976976
977977
model: The name of the `Model` used for generating the interaction.
978978

google/genai/_interactions/types/content_delta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class DeltaThoughtSummaryDelta(BaseModel):
138138
type: Literal["thought_summary"]
139139

140140
content: Optional[DeltaThoughtSummaryDeltaContent] = None
141-
"""A text content block."""
141+
"""A new summary item to be added to the thought."""
142142

143143

144144
class DeltaThoughtSignatureDelta(BaseModel):

google/genai/_interactions/types/function_result_content.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,18 @@
1616
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1717

1818
from typing import List, Union, Optional
19-
from typing_extensions import Literal, TypeAlias
19+
from typing_extensions import Literal, Annotated, TypeAlias
2020

21+
from .._utils import PropertyInfo
2122
from .._models import BaseModel
2223
from .text_content import TextContent
2324
from .image_content import ImageContent
2425

25-
__all__ = ["FunctionResultContent", "Result", "ResultItems", "ResultItemsItem"]
26+
__all__ = ["FunctionResultContent", "ResultFunctionResultSubcontentList"]
2627

27-
ResultItemsItem: TypeAlias = Union[TextContent, ImageContent]
28-
29-
30-
class ResultItems(BaseModel):
31-
items: Optional[List[ResultItemsItem]] = None
32-
33-
34-
Result: TypeAlias = Union[ResultItems, str, object]
28+
ResultFunctionResultSubcontentList: TypeAlias = Annotated[
29+
Union[TextContent, ImageContent], PropertyInfo(discriminator="type")
30+
]
3531

3632

3733
class FunctionResultContent(BaseModel):
@@ -40,7 +36,7 @@ class FunctionResultContent(BaseModel):
4036
call_id: str
4137
"""ID to match the ID from the function call block."""
4238

43-
result: Result
39+
result: Union[List[ResultFunctionResultSubcontentList], str, object]
4440
"""The result of the tool call."""
4541

4642
type: Literal["function_result"]

google/genai/_interactions/types/function_result_content_param.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,9 @@
2323
from .text_content_param import TextContentParam
2424
from .image_content_param import ImageContentParam
2525

26-
__all__ = ["FunctionResultContentParam", "Result", "ResultItems", "ResultItemsItem"]
26+
__all__ = ["FunctionResultContentParam", "ResultFunctionResultSubcontentList"]
2727

28-
ResultItemsItem: TypeAlias = Union[TextContentParam, ImageContentParam]
29-
30-
31-
class ResultItems(TypedDict, total=False):
32-
items: Iterable[ResultItemsItem]
33-
34-
35-
Result: TypeAlias = Union[ResultItems, str, object]
28+
ResultFunctionResultSubcontentList: TypeAlias = Union[TextContentParam, ImageContentParam]
3629

3730

3831
class FunctionResultContentParam(TypedDict, total=False):
@@ -41,7 +34,7 @@ class FunctionResultContentParam(TypedDict, total=False):
4134
call_id: Required[str]
4235
"""ID to match the ID from the function call block."""
4336

44-
result: Required[Result]
37+
result: Required[Union[Iterable[ResultFunctionResultSubcontentList], str, object]]
4538
"""The result of the tool call."""
4639

4740
type: Required[Literal["function_result"]]

google/genai/_interactions/types/interaction.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
]
5555

5656
Input: TypeAlias = Union[
57-
str,
5857
List[Content],
58+
str,
5959
List[Turn],
6060
TextContent,
6161
ImageContent,
@@ -105,10 +105,10 @@ class Interaction(BaseModel):
105105
"""The name of the `Agent` used for generating the interaction."""
106106

107107
agent_config: Optional[AgentConfig] = None
108-
"""Configuration for the agent."""
108+
"""Configuration parameters for the agent interaction."""
109109

110110
input: Optional[Input] = None
111-
"""The inputs for the interaction."""
111+
"""The input for the interaction."""
112112

113113
model: Optional[Model] = None
114114
"""The name of the `Model` used for generating the interaction."""

google/genai/_interactions/types/interaction_create_params.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class BaseCreateModelInteractionParams(TypedDict, total=False):
6262
api_version: str
6363

6464
input: Required[Input]
65-
"""The inputs for the interaction."""
65+
"""The input for the interaction."""
6666

6767
model: Required[ModelParam]
6868
"""The name of the `Model` used for generating the interaction."""
@@ -99,8 +99,8 @@ class BaseCreateModelInteractionParams(TypedDict, total=False):
9999

100100

101101
Input: TypeAlias = Union[
102-
str,
103102
Iterable[ContentParam],
103+
str,
104104
Iterable[TurnParam],
105105
TextContentParam,
106106
ImageContentParam,
@@ -130,10 +130,10 @@ class BaseCreateAgentInteractionParams(TypedDict, total=False):
130130
"""The name of the `Agent` used for generating the interaction."""
131131

132132
input: Required[Input]
133-
"""The inputs for the interaction."""
133+
"""The input for the interaction."""
134134

135135
agent_config: AgentConfig
136-
"""Configuration for the agent."""
136+
"""Configuration parameters for the agent interaction."""
137137

138138
background: bool
139139
"""Input only. Whether to run the model interaction in the background."""

google/genai/_interactions/types/mcp_server_tool_result_content.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,18 @@
1616
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
1717

1818
from typing import List, Union, Optional
19-
from typing_extensions import Literal, TypeAlias
19+
from typing_extensions import Literal, Annotated, TypeAlias
2020

21+
from .._utils import PropertyInfo
2122
from .._models import BaseModel
2223
from .text_content import TextContent
2324
from .image_content import ImageContent
2425

25-
__all__ = ["MCPServerToolResultContent", "Result", "ResultItems", "ResultItemsItem"]
26+
__all__ = ["MCPServerToolResultContent", "ResultFunctionResultSubcontentList"]
2627

27-
ResultItemsItem: TypeAlias = Union[TextContent, ImageContent]
28-
29-
30-
class ResultItems(BaseModel):
31-
items: Optional[List[ResultItemsItem]] = None
32-
33-
34-
Result: TypeAlias = Union[ResultItems, str, object]
28+
ResultFunctionResultSubcontentList: TypeAlias = Annotated[
29+
Union[TextContent, ImageContent], PropertyInfo(discriminator="type")
30+
]
3531

3632

3733
class MCPServerToolResultContent(BaseModel):
@@ -40,8 +36,8 @@ class MCPServerToolResultContent(BaseModel):
4036
call_id: str
4137
"""ID to match the ID from the MCP server tool call block."""
4238

43-
result: Result
44-
"""The result of the tool call."""
39+
result: Union[List[ResultFunctionResultSubcontentList], str, object]
40+
"""The output from the MCP server call. Can be simple text or rich content."""
4541

4642
type: Literal["mcp_server_tool_result"]
4743

google/genai/_interactions/types/mcp_server_tool_result_content_param.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,9 @@
2323
from .text_content_param import TextContentParam
2424
from .image_content_param import ImageContentParam
2525

26-
__all__ = ["MCPServerToolResultContentParam", "Result", "ResultItems", "ResultItemsItem"]
26+
__all__ = ["MCPServerToolResultContentParam", "ResultFunctionResultSubcontentList"]
2727

28-
ResultItemsItem: TypeAlias = Union[TextContentParam, ImageContentParam]
29-
30-
31-
class ResultItems(TypedDict, total=False):
32-
items: Iterable[ResultItemsItem]
33-
34-
35-
Result: TypeAlias = Union[ResultItems, str, object]
28+
ResultFunctionResultSubcontentList: TypeAlias = Union[TextContentParam, ImageContentParam]
3629

3730

3831
class MCPServerToolResultContentParam(TypedDict, total=False):
@@ -41,8 +34,8 @@ class MCPServerToolResultContentParam(TypedDict, total=False):
4134
call_id: Required[str]
4235
"""ID to match the ID from the MCP server tool call block."""
4336

44-
result: Required[Result]
45-
"""The result of the tool call."""
37+
result: Required[Union[Iterable[ResultFunctionResultSubcontentList], str, object]]
38+
"""The output from the MCP server call. Can be simple text or rich content."""
4639

4740
type: Required[Literal["mcp_server_tool_result"]]
4841

google/genai/_interactions/types/tool.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,7 @@
2525
from .function import Function
2626
from .allowed_tools import AllowedTools
2727

28-
__all__ = ["Tool", "GoogleSearch", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "FileSearch"]
29-
30-
31-
class GoogleSearch(BaseModel):
32-
"""A tool that can be used by the model to search Google."""
33-
34-
type: Literal["google_search"]
35-
36-
search_types: Optional[List[Literal["web_search", "image_search"]]] = None
37-
"""The types of search grounding to enable."""
28+
__all__ = ["Tool", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "GoogleSearch", "FileSearch"]
3829

3930

4031
class CodeExecution(BaseModel):
@@ -82,6 +73,15 @@ class MCPServer(BaseModel):
8273
"""
8374

8475

76+
class GoogleSearch(BaseModel):
77+
"""A tool that can be used by the model to search Google."""
78+
79+
type: Literal["google_search"]
80+
81+
search_types: Optional[List[Literal["web_search", "image_search"]]] = None
82+
"""The types of search grounding to enable."""
83+
84+
8585
class FileSearch(BaseModel):
8686
"""A tool that can be used by the model to search files."""
8787

@@ -98,6 +98,6 @@ class FileSearch(BaseModel):
9898

9999

100100
Tool: TypeAlias = Annotated[
101-
Union[Function, GoogleSearch, CodeExecution, URLContext, ComputerUse, MCPServer, FileSearch],
101+
Union[Function, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch],
102102
PropertyInfo(discriminator="type"),
103103
]

google/genai/_interactions/types/tool_param.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,7 @@
2525
from .function_param import FunctionParam
2626
from .allowed_tools_param import AllowedToolsParam
2727

28-
__all__ = ["ToolParam", "GoogleSearch", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "FileSearch"]
29-
30-
31-
class GoogleSearch(TypedDict, total=False):
32-
"""A tool that can be used by the model to search Google."""
33-
34-
type: Required[Literal["google_search"]]
35-
36-
search_types: List[Literal["web_search", "image_search"]]
37-
"""The types of search grounding to enable."""
28+
__all__ = ["ToolParam", "CodeExecution", "URLContext", "ComputerUse", "MCPServer", "GoogleSearch", "FileSearch"]
3829

3930

4031
class CodeExecution(TypedDict, total=False):
@@ -82,6 +73,15 @@ class MCPServer(TypedDict, total=False):
8273
"""
8374

8475

76+
class GoogleSearch(TypedDict, total=False):
77+
"""A tool that can be used by the model to search Google."""
78+
79+
type: Required[Literal["google_search"]]
80+
81+
search_types: List[Literal["web_search", "image_search"]]
82+
"""The types of search grounding to enable."""
83+
84+
8585
class FileSearch(TypedDict, total=False):
8686
"""A tool that can be used by the model to search files."""
8787

@@ -97,4 +97,4 @@ class FileSearch(TypedDict, total=False):
9797
"""The number of semantic retrieval chunks to retrieve."""
9898

9999

100-
ToolParam: TypeAlias = Union[FunctionParam, GoogleSearch, CodeExecution, URLContext, ComputerUse, MCPServer, FileSearch]
100+
ToolParam: TypeAlias = Union[FunctionParam, CodeExecution, URLContext, ComputerUse, MCPServer, GoogleSearch, FileSearch]

0 commit comments

Comments
 (0)