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 @@
"DeltaThoughtSummaryContent",
"DeltaThoughtSignature",
"DeltaFunctionCall",
"DeltaFunctionResult",
"DeltaFunctionResultResult",
"DeltaFunctionResultResultItems",
"DeltaFunctionResultResultItemsItem",
"DeltaCodeExecutionCall",
"DeltaCodeExecutionResult",
"DeltaURLContextCall",
"DeltaURLContextResult",
"DeltaGoogleSearchCall",
"DeltaGoogleSearchResult",
"DeltaMCPServerToolCall",
"DeltaMCPServerToolResult",
"DeltaMCPServerToolResultResult",
"DeltaMCPServerToolResultResultItems",
"DeltaMCPServerToolResultResultItemsItem",
"DeltaFileSearchCall",
"DeltaFunctionResult",
"DeltaFunctionResultResultFunctionResultSubcontentList",
"DeltaCodeExecutionResult",
"DeltaURLContextResult",
"DeltaGoogleSearchResult",
"DeltaMCPServerToolResult",
"DeltaMCPServerToolResultResultFunctionResultSubcontentList",
"DeltaFileSearchResult",
"DeltaFileSearchResultResult",
]
Expand Down Expand Up @@ -157,22 +153,66 @@ class DeltaFunctionCall(BaseModel):
type: Literal["function_call"]


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

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

class DeltaFunctionResultResultItems(BaseModel):
items: Optional[List[DeltaFunctionResultResultItemsItem]] = None
type: Literal["code_execution_call"]


DeltaFunctionResultResult: TypeAlias = Union[DeltaFunctionResultResultItems, str, object]
class DeltaURLContextCall(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 DeltaGoogleSearchCall(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 DeltaMCPServerToolCall(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"]


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

type: Literal["file_search_call"]


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


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

result: DeltaFunctionResultResult
"""Tool call result delta."""
result: Union[List[DeltaFunctionResultResultFunctionResultSubcontentList], str, object]

type: Literal["function_result"]

Expand All @@ -184,16 +224,6 @@ class DeltaFunctionResult(BaseModel):
"""A signature hash for backend validation."""


class DeltaCodeExecutionCall(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 DeltaCodeExecutionResult(BaseModel):
call_id: str
"""ID to match the ID from the function call block."""
Expand All @@ -208,16 +238,6 @@ class DeltaCodeExecutionResult(BaseModel):
"""A signature hash for backend validation."""


class DeltaURLContextCall(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 DeltaURLContextResult(BaseModel):
call_id: str
"""ID to match the ID from the function call block."""
Expand All @@ -232,16 +252,6 @@ class DeltaURLContextResult(BaseModel):
"""A signature hash for backend validation."""


class DeltaGoogleSearchCall(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 DeltaGoogleSearchResult(BaseModel):
call_id: str
"""ID to match the ID from the function call block."""
Expand All @@ -256,35 +266,16 @@ class DeltaGoogleSearchResult(BaseModel):
"""A signature hash for backend validation."""


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


DeltaMCPServerToolResultResultItemsItem: TypeAlias = Union[TextContent, ImageContent]


class DeltaMCPServerToolResultResultItems(BaseModel):
items: Optional[List[DeltaMCPServerToolResultResultItemsItem]] = None


DeltaMCPServerToolResultResult: TypeAlias = Union[DeltaMCPServerToolResultResultItems, str, object]
DeltaMCPServerToolResultResultFunctionResultSubcontentList: TypeAlias = Annotated[
Union[TextContent, ImageContent], PropertyInfo(discriminator="type")
]


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

result: DeltaMCPServerToolResultResult
"""Tool call result delta."""
result: Union[List[DeltaMCPServerToolResultResultFunctionResultSubcontentList], str, object]

type: Literal["mcp_server_tool_result"]

Expand All @@ -296,13 +287,6 @@ class DeltaMCPServerToolResult(BaseModel):
"""A signature hash for backend validation."""


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

type: Literal["file_search_call"]


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

Expand Down Expand Up @@ -338,16 +322,16 @@ class DeltaFileSearchResult(BaseModel):
DeltaThoughtSummary,
DeltaThoughtSignature,
DeltaFunctionCall,
DeltaFunctionResult,
DeltaCodeExecutionCall,
DeltaCodeExecutionResult,
DeltaURLContextCall,
DeltaURLContextResult,
DeltaGoogleSearchCall,
DeltaGoogleSearchResult,
DeltaMCPServerToolCall,
DeltaMCPServerToolResult,
DeltaFileSearchCall,
DeltaFunctionResult,
DeltaCodeExecutionResult,
DeltaURLContextResult,
DeltaGoogleSearchResult,
DeltaMCPServerToolResult,
DeltaFileSearchResult,
],
PropertyInfo(discriminator="type"),
Expand All @@ -356,12 +340,14 @@ class DeltaFileSearchResult(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
Loading