diff --git a/google/genai/_interactions/types/__init__.py b/google/genai/_interactions/types/__init__.py index bd448df72..a98193110 100644 --- a/google/genai/_interactions/types/__init__.py +++ b/google/genai/_interactions/types/__init__.py @@ -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 @@ -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 @@ -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 diff --git a/google/genai/_interactions/types/interaction_event.py b/google/genai/_interactions/types/interaction_complete_event.py similarity index 87% rename from google/genai/_interactions/types/interaction_event.py rename to google/genai/_interactions/types/interaction_complete_event.py index 58f3d5418..843e1752c 100644 --- a/google/genai/_interactions/types/interaction_event.py +++ b/google/genai/_interactions/types/interaction_complete_event.py @@ -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.""" diff --git a/google/genai/_interactions/types/interaction_sse_event.py b/google/genai/_interactions/types/interaction_sse_event.py index bc0e84f81..0eee49201 100644 --- a/google/genai/_interactions/types/interaction_sse_event.py +++ b/google/genai/_interactions/types/interaction_sse_event.py @@ -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"), ] diff --git a/google/genai/_interactions/types/interaction_start_event.py b/google/genai/_interactions/types/interaction_start_event.py new file mode 100644 index 000000000..f637ddbb2 --- /dev/null +++ b/google/genai/_interactions/types/interaction_start_event.py @@ -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."""