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
10 changes: 5 additions & 5 deletions google/genai/_interactions/types/content.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@
VideoContent,
ThoughtContent,
FunctionCallContent,
FunctionResultContent,
CodeExecutionCallContent,
CodeExecutionResultContent,
URLContextCallContent,
URLContextResultContent,
MCPServerToolCallContent,
GoogleSearchCallContent,
FileSearchCallContent,
FunctionResultContent,
CodeExecutionResultContent,
URLContextResultContent,
GoogleSearchResultContent,
MCPServerToolCallContent,
MCPServerToolResultContent,
FileSearchCallContent,
FileSearchResultContent,
],
PropertyInfo(discriminator="type"),
Expand Down
152 changes: 69 additions & 83 deletions google/genai/_interactions/types/content_delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,18 @@
"DeltaThoughtSummaryDeltaContent",
"DeltaThoughtSignatureDelta",
"DeltaFunctionCallDelta",
"DeltaFunctionResultDelta",
"DeltaFunctionResultDeltaResult",
"DeltaFunctionResultDeltaResultItems",
"DeltaFunctionResultDeltaResultItemsItem",
"DeltaCodeExecutionCallDelta",
"DeltaCodeExecutionResultDelta",
"DeltaURLContextCallDelta",
"DeltaURLContextResultDelta",
"DeltaGoogleSearchCallDelta",
"DeltaGoogleSearchResultDelta",
"DeltaMCPServerToolCallDelta",
"DeltaMCPServerToolResultDelta",
"DeltaMCPServerToolResultDeltaResult",
"DeltaMCPServerToolResultDeltaResultItems",
"DeltaMCPServerToolResultDeltaResultItemsItem",
"DeltaFileSearchCallDelta",
"DeltaFunctionResultDelta",
"DeltaFunctionResultDeltaResultFunctionResultSubcontentList",
"DeltaCodeExecutionResultDelta",
"DeltaURLContextResultDelta",
"DeltaGoogleSearchResultDelta",
"DeltaMCPServerToolResultDelta",
"DeltaMCPServerToolResultDeltaResultFunctionResultSubcontentList",
"DeltaFileSearchResultDelta",
"DeltaFileSearchResultDeltaResult",
]
Expand Down Expand Up @@ -159,22 +155,66 @@ class DeltaFunctionCallDelta(BaseModel):
type: Literal["function_call"]


DeltaFunctionResultDeltaResultItemsItem: TypeAlias = Union[TextContent, ImageContent]
class DeltaCodeExecutionCallDelta(BaseModel):
id: str
"""A unique ID for this specific tool call."""

arguments: CodeExecutionCallArguments
"""The arguments to pass to the code execution."""

type: Literal["code_execution_call"]


class DeltaURLContextCallDelta(BaseModel):
id: str
"""A unique ID for this specific tool call."""

arguments: URLContextCallArguments
"""The arguments to pass to the URL context."""

type: Literal["url_context_call"]


class DeltaGoogleSearchCallDelta(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"]


class DeltaMCPServerToolCallDelta(BaseModel):
id: str
"""A unique ID for this specific tool call."""

arguments: Dict[str, object]

class DeltaFunctionResultDeltaResultItems(BaseModel):
items: Optional[List[DeltaFunctionResultDeltaResultItemsItem]] = None
name: str

server_name: str

DeltaFunctionResultDeltaResult: TypeAlias = Union[DeltaFunctionResultDeltaResultItems, str, object]
type: Literal["mcp_server_tool_call"]


class DeltaFileSearchCallDelta(BaseModel):
id: str
"""A unique ID for this specific tool call."""

type: Literal["file_search_call"]


DeltaFunctionResultDeltaResultFunctionResultSubcontentList: TypeAlias = Annotated[
Union[TextContent, ImageContent], PropertyInfo(discriminator="type")
]


class DeltaFunctionResultDelta(BaseModel):
call_id: str
"""ID to match the ID from the function call block."""

result: DeltaFunctionResultDeltaResult
"""Tool call result delta."""
result: Union[List[DeltaFunctionResultDeltaResultFunctionResultSubcontentList], str, object]

type: Literal["function_result"]

Expand All @@ -186,16 +226,6 @@ class DeltaFunctionResultDelta(BaseModel):
"""A signature hash for backend validation."""


class DeltaCodeExecutionCallDelta(BaseModel):
id: str
"""A unique ID for this specific tool call."""

arguments: CodeExecutionCallArguments
"""The arguments to pass to the code execution."""

type: Literal["code_execution_call"]


class DeltaCodeExecutionResultDelta(BaseModel):
call_id: str
"""ID to match the ID from the function call block."""
Expand All @@ -210,16 +240,6 @@ class DeltaCodeExecutionResultDelta(BaseModel):
"""A signature hash for backend validation."""


class DeltaURLContextCallDelta(BaseModel):
id: str
"""A unique ID for this specific tool call."""

arguments: URLContextCallArguments
"""The arguments to pass to the URL context."""

type: Literal["url_context_call"]


class DeltaURLContextResultDelta(BaseModel):
call_id: str
"""ID to match the ID from the function call block."""
Expand All @@ -234,16 +254,6 @@ class DeltaURLContextResultDelta(BaseModel):
"""A signature hash for backend validation."""


class DeltaGoogleSearchCallDelta(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"]


class DeltaGoogleSearchResultDelta(BaseModel):
call_id: str
"""ID to match the ID from the function call block."""
Expand All @@ -258,35 +268,16 @@ class DeltaGoogleSearchResultDelta(BaseModel):
"""A signature hash for backend validation."""


class DeltaMCPServerToolCallDelta(BaseModel):
id: str
"""A unique ID for this specific tool call."""

arguments: Dict[str, object]

name: str

server_name: str

type: Literal["mcp_server_tool_call"]


DeltaMCPServerToolResultDeltaResultItemsItem: TypeAlias = Union[TextContent, ImageContent]


class DeltaMCPServerToolResultDeltaResultItems(BaseModel):
items: Optional[List[DeltaMCPServerToolResultDeltaResultItemsItem]] = None


DeltaMCPServerToolResultDeltaResult: TypeAlias = Union[DeltaMCPServerToolResultDeltaResultItems, str, object]
DeltaMCPServerToolResultDeltaResultFunctionResultSubcontentList: TypeAlias = Annotated[
Union[TextContent, ImageContent], PropertyInfo(discriminator="type")
]


class DeltaMCPServerToolResultDelta(BaseModel):
call_id: str
"""ID to match the ID from the function call block."""

result: DeltaMCPServerToolResultDeltaResult
"""Tool call result delta."""
result: Union[List[DeltaMCPServerToolResultDeltaResultFunctionResultSubcontentList], str, object]

type: Literal["mcp_server_tool_result"]

Expand All @@ -298,13 +289,6 @@ class DeltaMCPServerToolResultDelta(BaseModel):
"""A signature hash for backend validation."""


class DeltaFileSearchCallDelta(BaseModel):
id: str
"""A unique ID for this specific tool call."""

type: Literal["file_search_call"]


class DeltaFileSearchResultDeltaResult(BaseModel):
"""The result of the File Search."""

Expand Down Expand Up @@ -340,16 +324,16 @@ class DeltaFileSearchResultDelta(BaseModel):
DeltaThoughtSummaryDelta,
DeltaThoughtSignatureDelta,
DeltaFunctionCallDelta,
DeltaFunctionResultDelta,
DeltaCodeExecutionCallDelta,
DeltaCodeExecutionResultDelta,
DeltaURLContextCallDelta,
DeltaURLContextResultDelta,
DeltaGoogleSearchCallDelta,
DeltaGoogleSearchResultDelta,
DeltaMCPServerToolCallDelta,
DeltaMCPServerToolResultDelta,
DeltaFileSearchCallDelta,
DeltaFunctionResultDelta,
DeltaCodeExecutionResultDelta,
DeltaURLContextResultDelta,
DeltaGoogleSearchResultDelta,
DeltaMCPServerToolResultDelta,
DeltaFileSearchResultDelta,
],
PropertyInfo(discriminator="type"),
Expand All @@ -358,12 +342,14 @@ class DeltaFileSearchResultDelta(BaseModel):

class ContentDelta(BaseModel):
delta: Delta
"""The delta content data for a content block."""

event_type: Literal["content.delta"]

index: int

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.
"""
10 changes: 5 additions & 5 deletions google/genai/_interactions/types/content_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
VideoContentParam,
ThoughtContentParam,
FunctionCallContentParam,
FunctionResultContentParam,
CodeExecutionCallContentParam,
CodeExecutionResultContentParam,
URLContextCallContentParam,
URLContextResultContentParam,
MCPServerToolCallContentParam,
GoogleSearchCallContentParam,
FileSearchCallContentParam,
FunctionResultContentParam,
CodeExecutionResultContentParam,
URLContextResultContentParam,
GoogleSearchResultContentParam,
MCPServerToolCallContentParam,
MCPServerToolResultContentParam,
FileSearchCallContentParam,
FileSearchResultContentParam,
]
3 changes: 2 additions & 1 deletion google/genai/_interactions/types/content_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
3 changes: 2 additions & 1 deletion google/genai/_interactions/types/content_stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
3 changes: 2 additions & 1 deletion google/genai/_interactions/types/error_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
2 changes: 1 addition & 1 deletion google/genai/_interactions/types/generation_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
10 changes: 5 additions & 5 deletions google/genai/_interactions/types/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@
VideoContent,
ThoughtContent,
FunctionCallContent,
FunctionResultContent,
CodeExecutionCallContent,
CodeExecutionResultContent,
URLContextCallContent,
URLContextResultContent,
MCPServerToolCallContent,
GoogleSearchCallContent,
FileSearchCallContent,
FunctionResultContent,
CodeExecutionResultContent,
URLContextResultContent,
GoogleSearchResultContent,
MCPServerToolCallContent,
MCPServerToolResultContent,
FileSearchCallContent,
FileSearchResultContent,
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
10 changes: 5 additions & 5 deletions google/genai/_interactions/types/interaction_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ class BaseCreateModelInteractionParams(TypedDict, total=False):
VideoContentParam,
ThoughtContentParam,
FunctionCallContentParam,
FunctionResultContentParam,
CodeExecutionCallContentParam,
CodeExecutionResultContentParam,
URLContextCallContentParam,
URLContextResultContentParam,
MCPServerToolCallContentParam,
GoogleSearchCallContentParam,
FileSearchCallContentParam,
FunctionResultContentParam,
CodeExecutionResultContentParam,
URLContextResultContentParam,
GoogleSearchResultContentParam,
MCPServerToolCallContentParam,
MCPServerToolResultContentParam,
FileSearchCallContentParam,
FileSearchResultContentParam,
]

Expand Down
3 changes: 2 additions & 1 deletion google/genai/_interactions/types/interaction_start_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Loading