Skip to content

Commit 6d303e4

Browse files
Annhiluccopybara-github
authored andcommitted
chore: Split InteractionEvent into InteractionStartEvent and InteractionCompleteEvent.
PiperOrigin-RevId: 861417954
1 parent c9851d6 commit 6d303e4

File tree

4 files changed

+52
-6
lines changed

4 files changed

+52
-6
lines changed

google/genai/_interactions/types/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
from .document_content import DocumentContent as DocumentContent
5353
from .tool_choice_type import ToolChoiceType as ToolChoiceType
5454
from .generation_config import GenerationConfig as GenerationConfig
55-
from .interaction_event import InteractionEvent as InteractionEvent
5655
from .tool_choice_param import ToolChoiceParam as ToolChoiceParam
5756
from .document_mime_type import DocumentMimeType as DocumentMimeType
5857
from .image_config_param import ImageConfigParam as ImageConfigParam
@@ -76,6 +75,7 @@
7675
from .interaction_get_params import InteractionGetParams as InteractionGetParams
7776
from .function_result_content import FunctionResultContent as FunctionResultContent
7877
from .generation_config_param import GenerationConfigParam as GenerationConfigParam
78+
from .interaction_start_event import InteractionStartEvent as InteractionStartEvent
7979
from .document_mime_type_param import DocumentMimeTypeParam as DocumentMimeTypeParam
8080
from .file_search_call_content import FileSearchCallContent as FileSearchCallContent
8181
from .tool_choice_config_param import ToolChoiceConfigParam as ToolChoiceConfigParam
@@ -88,6 +88,7 @@
8888
from .file_search_result_content import FileSearchResultContent as FileSearchResultContent
8989
from .google_search_call_content import GoogleSearchCallContent as GoogleSearchCallContent
9090
from .google_search_result_param import GoogleSearchResultParam as GoogleSearchResultParam
91+
from .interaction_complete_event import InteractionCompleteEvent as InteractionCompleteEvent
9192
from .url_context_call_arguments import URLContextCallArguments as URLContextCallArguments
9293
from .url_context_result_content import URLContextResultContent as URLContextResultContent
9394
from .code_execution_call_content import CodeExecutionCallContent as CodeExecutionCallContent

google/genai/_interactions/types/interaction_event.py renamed to google/genai/_interactions/types/interaction_complete_event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
from .._models import BaseModel
2222
from .interaction import Interaction
2323

24-
__all__ = ["InteractionEvent"]
24+
__all__ = ["InteractionCompleteEvent"]
2525

2626

27-
class InteractionEvent(BaseModel):
27+
class InteractionCompleteEvent(BaseModel):
2828
event_id: Optional[str] = None
2929
"""
3030
The event_id token to be used to resume the interaction stream, from this event.
3131
"""
3232

33-
event_type: Optional[Literal["interaction.start", "interaction.complete"]] = None
33+
event_type: Optional[Literal["interaction.complete"]] = None
3434

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

google/genai/_interactions/types/interaction_sse_event.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,21 @@
2323
from .content_stop import ContentStop
2424
from .content_delta import ContentDelta
2525
from .content_start import ContentStart
26-
from .interaction_event import InteractionEvent
26+
from .interaction_start_event import InteractionStartEvent
2727
from .interaction_status_update import InteractionStatusUpdate
28+
from .interaction_complete_event import InteractionCompleteEvent
2829

2930
__all__ = ["InteractionSSEEvent"]
3031

3132
InteractionSSEEvent: TypeAlias = Annotated[
32-
Union[InteractionEvent, InteractionStatusUpdate, ContentStart, ContentDelta, ContentStop, ErrorEvent],
33+
Union[
34+
InteractionStartEvent,
35+
InteractionCompleteEvent,
36+
InteractionStatusUpdate,
37+
ContentStart,
38+
ContentDelta,
39+
ContentStop,
40+
ErrorEvent,
41+
],
3342
PropertyInfo(discriminator="event_type"),
3443
]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
16+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
17+
18+
from typing import Optional
19+
from typing_extensions import Literal
20+
21+
from .._models import BaseModel
22+
from .interaction import Interaction
23+
24+
__all__ = ["InteractionStartEvent"]
25+
26+
27+
class InteractionStartEvent(BaseModel):
28+
event_id: Optional[str] = None
29+
"""
30+
The event_id token to be used to resume the interaction stream, from this event.
31+
"""
32+
33+
event_type: Optional[Literal["interaction.start"]] = None
34+
35+
interaction: Optional[Interaction] = None
36+
"""The Interaction resource."""

0 commit comments

Comments
 (0)