Skip to content

Commit 396633c

Browse files
MarkDaoustcopybara-github
authored andcommitted
chore: Update interactions
PiperOrigin-RevId: 862444107
1 parent 9e49d71 commit 396633c

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

google/genai/_interactions/resources/interactions.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def with_streaming_response(self) -> InteractionsResourceWithStreamingResponse:
6868
def create(
6969
self,
7070
*,
71+
api_version: str | None = None,
7172
input: interaction_create_params.Input,
7273
model: ModelParam,
73-
api_version: str | None = None,
7474
background: bool | Omit = omit,
7575
generation_config: GenerationConfigParam | Omit = omit,
7676
previous_interaction_id: str | Omit = omit,
@@ -131,10 +131,10 @@ def create(
131131
def create(
132132
self,
133133
*,
134+
api_version: str | None = None,
134135
input: interaction_create_params.Input,
135136
model: ModelParam,
136137
stream: Literal[True],
137-
api_version: str | None = None,
138138
background: bool | Omit = omit,
139139
generation_config: GenerationConfigParam | Omit = omit,
140140
previous_interaction_id: str | Omit = omit,
@@ -194,9 +194,9 @@ def create(
194194
def create(
195195
self,
196196
*,
197+
api_version: str | None = None,
197198
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]],
198199
input: interaction_create_params.Input,
199-
api_version: str | None = None,
200200
agent_config: interaction_create_params.AgentConfig | Omit = omit,
201201
background: bool | Omit = omit,
202202
previous_interaction_id: str | Omit = omit,
@@ -257,10 +257,10 @@ def create(
257257
def create(
258258
self,
259259
*,
260+
api_version: str | None = None,
260261
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]],
261262
input: interaction_create_params.Input,
262263
stream: Literal[True],
263-
api_version: str | None = None,
264264
agent_config: interaction_create_params.AgentConfig | Omit = omit,
265265
background: bool | Omit = omit,
266266
previous_interaction_id: str | Omit = omit,
@@ -320,10 +320,10 @@ def create(
320320
def create(
321321
self,
322322
*,
323+
api_version: str | None = None,
323324
input: interaction_create_params.Input,
324325
model: ModelParam,
325326
stream: bool,
326-
api_version: str | None = None,
327327
background: bool | Omit = omit,
328328
generation_config: GenerationConfigParam | Omit = omit,
329329
previous_interaction_id: str | Omit = omit,
@@ -383,9 +383,9 @@ def create(
383383
def create(
384384
self,
385385
*,
386+
api_version: str | None = None,
386387
input: interaction_create_params.Input,
387388
model: ModelParam | Omit = omit,
388-
api_version: str | None = None,
389389
background: bool | Omit = omit,
390390
generation_config: GenerationConfigParam | Omit = omit,
391391
previous_interaction_id: str | Omit = omit,
@@ -468,12 +468,12 @@ def delete(
468468
469469
timeout: Override the client-level default timeout for this request, in seconds
470470
"""
471-
if not id:
472-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
473471
if api_version is None:
474472
api_version = self._client._get_api_version_path_param()
475473
if not api_version:
476474
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
475+
if not id:
476+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
477477
return self._delete(
478478
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}'),
479479
options=make_request_options(
@@ -507,12 +507,12 @@ def cancel(
507507
508508
timeout: Override the client-level default timeout for this request, in seconds
509509
"""
510-
if not id:
511-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
512510
if api_version is None:
513511
api_version = self._client._get_api_version_path_param()
514512
if not api_version:
515513
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
514+
if not id:
515+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
516516
return self._post(
517517
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}/cancel'),
518518
options=make_request_options(
@@ -562,8 +562,8 @@ def get(
562562
self,
563563
id: str,
564564
*,
565-
stream: Literal[True],
566565
api_version: str | None = None,
566+
stream: Literal[True],
567567
include_input: bool | Omit = omit,
568568
last_event_id: str | Omit = omit,
569569
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -598,8 +598,8 @@ def get(
598598
self,
599599
id: str,
600600
*,
601-
stream: bool,
602601
api_version: str | None = None,
602+
stream: bool,
603603
include_input: bool | Omit = omit,
604604
last_event_id: str | Omit = omit,
605605
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -644,12 +644,12 @@ def get(
644644
extra_body: Body | None = None,
645645
timeout: float | httpx.Timeout | None | NotGiven = not_given,
646646
) -> Interaction | Stream[InteractionSSEEvent]:
647-
if not id:
648-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
649647
if api_version is None:
650648
api_version = self._client._get_api_version_path_param()
651649
if not api_version:
652650
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
651+
if not id:
652+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
653653
return self._get(
654654
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}'),
655655
options=make_request_options(
@@ -696,9 +696,9 @@ def with_streaming_response(self) -> AsyncInteractionsResourceWithStreamingRespo
696696
async def create(
697697
self,
698698
*,
699+
api_version: str | None = None,
699700
input: interaction_create_params.Input,
700701
model: ModelParam,
701-
api_version: str | None = None,
702702
background: bool | Omit = omit,
703703
generation_config: GenerationConfigParam | Omit = omit,
704704
previous_interaction_id: str | Omit = omit,
@@ -759,10 +759,10 @@ async def create(
759759
async def create(
760760
self,
761761
*,
762+
api_version: str | None = None,
762763
input: interaction_create_params.Input,
763764
model: ModelParam,
764765
stream: Literal[True],
765-
api_version: str | None = None,
766766
background: bool | Omit = omit,
767767
generation_config: GenerationConfigParam | Omit = omit,
768768
previous_interaction_id: str | Omit = omit,
@@ -822,9 +822,9 @@ async def create(
822822
async def create(
823823
self,
824824
*,
825+
api_version: str | None = None,
825826
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]],
826827
input: interaction_create_params.Input,
827-
api_version: str | None = None,
828828
agent_config: interaction_create_params.AgentConfig | Omit = omit,
829829
background: bool | Omit = omit,
830830
previous_interaction_id: str | Omit = omit,
@@ -885,10 +885,10 @@ async def create(
885885
async def create(
886886
self,
887887
*,
888+
api_version: str | None = None,
888889
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]],
889890
input: interaction_create_params.Input,
890891
stream: Literal[True],
891-
api_version: str | None = None,
892892
agent_config: interaction_create_params.AgentConfig | Omit = omit,
893893
background: bool | Omit = omit,
894894
previous_interaction_id: str | Omit = omit,
@@ -948,10 +948,10 @@ async def create(
948948
async def create(
949949
self,
950950
*,
951+
api_version: str | None = None,
951952
input: interaction_create_params.Input,
952953
model: ModelParam,
953954
stream: bool,
954-
api_version: str | None = None,
955955
background: bool | Omit = omit,
956956
generation_config: GenerationConfigParam | Omit = omit,
957957
previous_interaction_id: str | Omit = omit,
@@ -1011,9 +1011,9 @@ async def create(
10111011
async def create(
10121012
self,
10131013
*,
1014+
api_version: str | None = None,
10141015
input: interaction_create_params.Input,
10151016
model: ModelParam | Omit = omit,
1016-
api_version: str | None = None,
10171017
background: bool | Omit = omit,
10181018
generation_config: GenerationConfigParam | Omit = omit,
10191019
previous_interaction_id: str | Omit = omit,
@@ -1096,12 +1096,12 @@ async def delete(
10961096
10971097
timeout: Override the client-level default timeout for this request, in seconds
10981098
"""
1099-
if not id:
1100-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
11011099
if api_version is None:
11021100
api_version = self._client._get_api_version_path_param()
11031101
if not api_version:
11041102
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
1103+
if not id:
1104+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
11051105
return await self._delete(
11061106
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}'),
11071107
options=make_request_options(
@@ -1135,12 +1135,12 @@ async def cancel(
11351135
11361136
timeout: Override the client-level default timeout for this request, in seconds
11371137
"""
1138-
if not id:
1139-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
11401138
if api_version is None:
11411139
api_version = self._client._get_api_version_path_param()
11421140
if not api_version:
11431141
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
1142+
if not id:
1143+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
11441144
return await self._post(
11451145
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}/cancel'),
11461146
options=make_request_options(
@@ -1190,8 +1190,8 @@ async def get(
11901190
self,
11911191
id: str,
11921192
*,
1193-
stream: Literal[True],
11941193
api_version: str | None = None,
1194+
stream: Literal[True],
11951195
include_input: bool | Omit = omit,
11961196
last_event_id: str | Omit = omit,
11971197
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1226,8 +1226,8 @@ async def get(
12261226
self,
12271227
id: str,
12281228
*,
1229-
stream: bool,
12301229
api_version: str | None = None,
1230+
stream: bool,
12311231
include_input: bool | Omit = omit,
12321232
last_event_id: str | Omit = omit,
12331233
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -1272,12 +1272,12 @@ async def get(
12721272
extra_body: Body | None = None,
12731273
timeout: float | httpx.Timeout | None | NotGiven = not_given,
12741274
) -> Interaction | AsyncStream[InteractionSSEEvent]:
1275-
if not id:
1276-
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
12771275
if api_version is None:
12781276
api_version = self._client._get_api_version_path_param()
12791277
if not api_version:
12801278
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
1279+
if not id:
1280+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
12811281
return await self._get(
12821282
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}'),
12831283
options=make_request_options(

google/genai/_interactions/types/interaction_create_params.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@
5959

6060

6161
class BaseCreateModelInteractionParams(TypedDict, total=False):
62+
api_version: str
63+
6264
input: Required[Input]
6365
"""The inputs for the interaction."""
6466

6567
model: Required[ModelParam]
6668
"""The name of the `Model` used for generating the interaction."""
6769

68-
api_version: str
69-
7070
background: bool
7171
"""Input only. Whether to run the model interaction in the background."""
7272

@@ -124,14 +124,14 @@ class BaseCreateModelInteractionParams(TypedDict, total=False):
124124

125125

126126
class BaseCreateAgentInteractionParams(TypedDict, total=False):
127+
api_version: str
128+
127129
agent: Required[Union[str, Literal["deep-research-pro-preview-12-2025"]]]
128130
"""The name of the `Agent` used for generating the interaction."""
129131

130132
input: Required[Input]
131133
"""The inputs for the interaction."""
132134

133-
api_version: str
134-
135135
agent_config: AgentConfig
136136
"""Configuration for the agent."""
137137

0 commit comments

Comments
 (0)