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
3 changes: 2 additions & 1 deletion google/genai/_interactions/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
from .document_content import DocumentContent as DocumentContent
from .tool_choice_type import ToolChoiceType as ToolChoiceType
from .generation_config import GenerationConfig as GenerationConfig
from .interaction_event import InteractionEvent as InteractionEvent
from .tool_choice_param import ToolChoiceParam as ToolChoiceParam
from .document_mime_type import DocumentMimeType as DocumentMimeType
from .image_config_param import ImageConfigParam as ImageConfigParam
Expand All @@ -76,6 +75,7 @@
from .interaction_get_params import InteractionGetParams as InteractionGetParams
from .function_result_content import FunctionResultContent as FunctionResultContent
from .generation_config_param import GenerationConfigParam as GenerationConfigParam
from .interaction_start_event import InteractionStartEvent as InteractionStartEvent
from .document_mime_type_param import DocumentMimeTypeParam as DocumentMimeTypeParam
from .file_search_call_content import FileSearchCallContent as FileSearchCallContent
from .tool_choice_config_param import ToolChoiceConfigParam as ToolChoiceConfigParam
Expand All @@ -88,6 +88,7 @@
from .file_search_result_content import FileSearchResultContent as FileSearchResultContent
from .google_search_call_content import GoogleSearchCallContent as GoogleSearchCallContent
from .google_search_result_param import GoogleSearchResultParam as GoogleSearchResultParam
from .interaction_complete_event import InteractionCompleteEvent as InteractionCompleteEvent
from .url_context_call_arguments import URLContextCallArguments as URLContextCallArguments
from .url_context_result_content import URLContextResultContent as URLContextResultContent
from .code_execution_call_content import CodeExecutionCallContent as CodeExecutionCallContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
from .._models import BaseModel
from .interaction import Interaction

__all__ = ["InteractionEvent"]
__all__ = ["InteractionCompleteEvent"]


class InteractionEvent(BaseModel):
class InteractionCompleteEvent(BaseModel):
event_id: Optional[str] = None
"""
The event_id token to be used to resume the interaction stream, from this event.
"""

event_type: Optional[Literal["interaction.start", "interaction.complete"]] = None
event_type: Optional[Literal["interaction.complete"]] = None

interaction: Optional[Interaction] = None
"""The Interaction resource."""
13 changes: 11 additions & 2 deletions google/genai/_interactions/types/interaction_sse_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,21 @@
from .content_stop import ContentStop
from .content_delta import ContentDelta
from .content_start import ContentStart
from .interaction_event import InteractionEvent
from .interaction_start_event import InteractionStartEvent
from .interaction_status_update import InteractionStatusUpdate
from .interaction_complete_event import InteractionCompleteEvent

__all__ = ["InteractionSSEEvent"]

InteractionSSEEvent: TypeAlias = Annotated[
Union[InteractionEvent, InteractionStatusUpdate, ContentStart, ContentDelta, ContentStop, ErrorEvent],
Union[
InteractionStartEvent,
InteractionCompleteEvent,
InteractionStatusUpdate,
ContentStart,
ContentDelta,
ContentStop,
ErrorEvent,
],
PropertyInfo(discriminator="event_type"),
]
36 changes: 36 additions & 0 deletions google/genai/_interactions/types/interaction_start_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from .._models import BaseModel
from .interaction import Interaction

__all__ = ["InteractionStartEvent"]


class InteractionStartEvent(BaseModel):
event_id: Optional[str] = None
"""
The event_id token to be used to resume the interaction stream, from this event.
"""

event_type: Optional[Literal["interaction.start"]] = None

interaction: Optional[Interaction] = None
"""The Interaction resource."""