Skip to content

Commit 2e1020a

Browse files
hkt74copybara-github
authored andcommitted
chore: update comment
PiperOrigin-RevId: 879203048
1 parent 6c3379f commit 2e1020a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+230
-214
lines changed

google/genai/_interactions/_compat.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
1919
from datetime import date, datetime
20-
from typing_extensions import Self, Literal
20+
from typing_extensions import Self, Literal, TypedDict
2121

2222
import pydantic
2323
from pydantic.fields import FieldInfo
@@ -146,6 +146,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
146146
return model.model_dump_json(indent=indent)
147147

148148

149+
class _ModelDumpKwargs(TypedDict, total=False):
150+
by_alias: bool
151+
152+
149153
def model_dump(
150154
model: pydantic.BaseModel,
151155
*,
@@ -157,14 +161,17 @@ def model_dump(
157161
by_alias: bool | None = None,
158162
) -> dict[str, Any]:
159163
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
164+
kwargs: _ModelDumpKwargs = {}
165+
if by_alias is not None:
166+
kwargs["by_alias"] = by_alias
160167
return model.model_dump(
161168
mode=mode,
162169
exclude=exclude,
163170
exclude_unset=exclude_unset,
164171
exclude_defaults=exclude_defaults,
165172
# warnings are not supported in Pydantic v1
166173
warnings=True if PYDANTIC_V1 else warnings,
167-
by_alias=by_alias,
174+
**kwargs,
168175
)
169176
return cast(
170177
"dict[str, Any]",

google/genai/_interactions/types/code_execution_call_content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class CodeExecutionCallContent(BaseModel):
3131
"""A unique ID for this specific tool call."""
3232

3333
arguments: CodeExecutionCallArguments
34-
"""The arguments to pass to the code execution."""
34+
"""Required. The arguments to pass to the code execution."""
3535

3636
type: Literal["code_execution_call"]
3737

google/genai/_interactions/types/code_execution_call_content_param.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CodeExecutionCallContentParam(TypedDict, total=False):
3535
"""A unique ID for this specific tool call."""
3636

3737
arguments: Required[CodeExecutionCallArgumentsParam]
38-
"""The arguments to pass to the code execution."""
38+
"""Required. The arguments to pass to the code execution."""
3939

4040
type: Required[Literal["code_execution_call"]]
4141

google/genai/_interactions/types/code_execution_result_content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CodeExecutionResultContent(BaseModel):
3030
"""ID to match the ID from the code execution call block."""
3131

3232
result: str
33-
"""The output of the code execution."""
33+
"""Required. The output of the code execution."""
3434

3535
type: Literal["code_execution_result"]
3636

google/genai/_interactions/types/code_execution_result_content_param.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CodeExecutionResultContentParam(TypedDict, total=False):
3434
"""ID to match the ID from the code execution call block."""
3535

3636
result: Required[str]
37-
"""The output of the code execution."""
37+
"""Required. The output of the code execution."""
3838

3939
type: Required[Literal["code_execution_result"]]
4040

google/genai/_interactions/types/content.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@
5151
VideoContent,
5252
ThoughtContent,
5353
FunctionCallContent,
54-
FunctionResultContent,
5554
CodeExecutionCallContent,
56-
CodeExecutionResultContent,
5755
URLContextCallContent,
58-
URLContextResultContent,
56+
MCPServerToolCallContent,
5957
GoogleSearchCallContent,
58+
FileSearchCallContent,
59+
GoogleMapsCallContent,
60+
FunctionResultContent,
61+
CodeExecutionResultContent,
62+
URLContextResultContent,
6063
GoogleSearchResultContent,
61-
MCPServerToolCallContent,
6264
MCPServerToolResultContent,
63-
FileSearchCallContent,
6465
FileSearchResultContent,
65-
GoogleMapsCallContent,
6666
GoogleMapsResultContent,
6767
],
6868
PropertyInfo(discriminator="type"),

0 commit comments

Comments
 (0)