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
56 changes: 28 additions & 28 deletions google/genai/_interactions/resources/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def with_streaming_response(self) -> InteractionsResourceWithStreamingResponse:
def create(
self,
*,
api_version: str | None = None,
input: interaction_create_params.Input,
model: ModelParam,
api_version: str | None = None,
background: bool | Omit = omit,
generation_config: GenerationConfigParam | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -131,10 +131,10 @@ def create(
def create(
self,
*,
api_version: str | None = None,
input: interaction_create_params.Input,
model: ModelParam,
stream: Literal[True],
api_version: str | None = None,
background: bool | Omit = omit,
generation_config: GenerationConfigParam | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -194,9 +194,9 @@ def create(
def create(
self,
*,
api_version: str | None = None,
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]],
input: interaction_create_params.Input,
api_version: str | None = None,
agent_config: interaction_create_params.AgentConfig | Omit = omit,
background: bool | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -257,10 +257,10 @@ def create(
def create(
self,
*,
api_version: str | None = None,
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]],
input: interaction_create_params.Input,
stream: Literal[True],
api_version: str | None = None,
agent_config: interaction_create_params.AgentConfig | Omit = omit,
background: bool | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -320,10 +320,10 @@ def create(
def create(
self,
*,
api_version: str | None = None,
input: interaction_create_params.Input,
model: ModelParam,
stream: bool,
api_version: str | None = None,
background: bool | Omit = omit,
generation_config: GenerationConfigParam | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -383,9 +383,9 @@ def create(
def create(
self,
*,
api_version: str | None = None,
input: interaction_create_params.Input,
model: ModelParam | Omit = omit,
api_version: str | None = None,
background: bool | Omit = omit,
generation_config: GenerationConfigParam | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -468,12 +468,12 @@ def delete(

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._delete(
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}'),
options=make_request_options(
Expand Down Expand Up @@ -507,12 +507,12 @@ def cancel(

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._post(
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}/cancel'),
options=make_request_options(
Expand Down Expand Up @@ -562,8 +562,8 @@ def get(
self,
id: str,
*,
stream: Literal[True],
api_version: str | None = None,
stream: Literal[True],
include_input: bool | Omit = omit,
last_event_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -598,8 +598,8 @@ def get(
self,
id: str,
*,
stream: bool,
api_version: str | None = None,
stream: bool,
include_input: bool | Omit = omit,
last_event_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -644,12 +644,12 @@ def get(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Interaction | Stream[InteractionSSEEvent]:
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._get(
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}'),
options=make_request_options(
Expand Down Expand Up @@ -696,9 +696,9 @@ def with_streaming_response(self) -> AsyncInteractionsResourceWithStreamingRespo
async def create(
self,
*,
api_version: str | None = None,
input: interaction_create_params.Input,
model: ModelParam,
api_version: str | None = None,
background: bool | Omit = omit,
generation_config: GenerationConfigParam | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -759,10 +759,10 @@ async def create(
async def create(
self,
*,
api_version: str | None = None,
input: interaction_create_params.Input,
model: ModelParam,
stream: Literal[True],
api_version: str | None = None,
background: bool | Omit = omit,
generation_config: GenerationConfigParam | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -822,9 +822,9 @@ async def create(
async def create(
self,
*,
api_version: str | None = None,
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]],
input: interaction_create_params.Input,
api_version: str | None = None,
agent_config: interaction_create_params.AgentConfig | Omit = omit,
background: bool | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -885,10 +885,10 @@ async def create(
async def create(
self,
*,
api_version: str | None = None,
agent: Union[str, Literal["deep-research-pro-preview-12-2025"]],
input: interaction_create_params.Input,
stream: Literal[True],
api_version: str | None = None,
agent_config: interaction_create_params.AgentConfig | Omit = omit,
background: bool | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -948,10 +948,10 @@ async def create(
async def create(
self,
*,
api_version: str | None = None,
input: interaction_create_params.Input,
model: ModelParam,
stream: bool,
api_version: str | None = None,
background: bool | Omit = omit,
generation_config: GenerationConfigParam | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -1011,9 +1011,9 @@ async def create(
async def create(
self,
*,
api_version: str | None = None,
input: interaction_create_params.Input,
model: ModelParam | Omit = omit,
api_version: str | None = None,
background: bool | Omit = omit,
generation_config: GenerationConfigParam | Omit = omit,
previous_interaction_id: str | Omit = omit,
Expand Down Expand Up @@ -1096,12 +1096,12 @@ async def delete(

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._delete(
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}'),
options=make_request_options(
Expand Down Expand Up @@ -1135,12 +1135,12 @@ async def cancel(

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._post(
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}/cancel'),
options=make_request_options(
Expand Down Expand Up @@ -1190,8 +1190,8 @@ async def get(
self,
id: str,
*,
stream: Literal[True],
api_version: str | None = None,
stream: Literal[True],
include_input: bool | Omit = omit,
last_event_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -1226,8 +1226,8 @@ async def get(
self,
id: str,
*,
stream: bool,
api_version: str | None = None,
stream: bool,
include_input: bool | Omit = omit,
last_event_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -1272,12 +1272,12 @@ async def get(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Interaction | AsyncStream[InteractionSSEEvent]:
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
if api_version is None:
api_version = self._client._get_api_version_path_param()
if not api_version:
raise ValueError(f"Expected a non-empty value for `api_version` but received {api_version!r}")
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._get(
self._client._build_maybe_vertex_path(api_version=api_version, path=f'interactions/{id}'),
options=make_request_options(
Expand Down
8 changes: 4 additions & 4 deletions google/genai/_interactions/types/interaction_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@


class BaseCreateModelInteractionParams(TypedDict, total=False):
api_version: str

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

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

api_version: str

background: bool
"""Input only. Whether to run the model interaction in the background."""

Expand Down Expand Up @@ -124,14 +124,14 @@ class BaseCreateModelInteractionParams(TypedDict, total=False):


class BaseCreateAgentInteractionParams(TypedDict, total=False):
api_version: str

agent: Required[Union[str, Literal["deep-research-pro-preview-12-2025"]]]
"""The name of the `Agent` used for generating the interaction."""

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

api_version: str

agent_config: AgentConfig
"""Configuration for the agent."""

Expand Down