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
42 changes: 41 additions & 1 deletion google/genai/_gaos/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from .utils.eventstreaming import AsyncStream, Stream
from .utils.unmarshal_json_response import unmarshal_json_response
import httpx
from typing import Any, List, Literal, Mapping, Optional, Union, cast, overload
from typing import Any, Dict, List, Literal, Mapping, Optional, Union, cast, overload


class Interactions(BaseSDK):
Expand Down Expand Up @@ -80,6 +80,8 @@ def create(
environment: interactions.CreateModelInteractionEnvironmentParam = ...,
generation_config: interactions.GenerationConfigParam = ...,
cached_content: str = ...,
safety_settings: List[interactions.SafetySettingParam] = ...,
labels: Dict[str, str] = ...,
input: interactions.InteractionsInputParam,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
Expand Down Expand Up @@ -110,6 +112,8 @@ def create(
caching (e.g. what content to cache) and enjoy guaranteed cost savings.
Format:
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
Expand Down Expand Up @@ -137,6 +141,8 @@ def create(
environment: interactions.CreateModelInteractionEnvironmentParam = ...,
generation_config: interactions.GenerationConfigParam = ...,
cached_content: str = ...,
safety_settings: List[interactions.SafetySettingParam] = ...,
labels: Dict[str, str] = ...,
input: interactions.InteractionsInputParam,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
Expand Down Expand Up @@ -167,6 +173,8 @@ def create(
caching (e.g. what content to cache) and enjoy guaranteed cost savings.
Format:
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
Expand All @@ -193,6 +201,8 @@ def create(
response_format: interactions.CreateAgentInteractionResponseFormatParam = ...,
environment: interactions.CreateAgentInteractionEnvironmentParam = ...,
agent_config: interactions.CreateAgentInteractionAgentConfigParam = ...,
safety_settings: List[interactions.SafetySettingParam] = ...,
labels: Dict[str, str] = ...,
input: interactions.InteractionsInputParam,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
Expand All @@ -218,6 +228,8 @@ def create(
:param response_format: Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
:param environment: The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.
:param agent_config: Configuration parameters for the agent interaction.
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
Expand All @@ -244,6 +256,8 @@ def create(
response_format: interactions.CreateAgentInteractionResponseFormatParam = ...,
environment: interactions.CreateAgentInteractionEnvironmentParam = ...,
agent_config: interactions.CreateAgentInteractionAgentConfigParam = ...,
safety_settings: List[interactions.SafetySettingParam] = ...,
labels: Dict[str, str] = ...,
input: interactions.InteractionsInputParam,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
Expand All @@ -269,6 +283,8 @@ def create(
:param response_format: Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
:param environment: The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.
:param agent_config: Configuration parameters for the agent interaction.
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
Expand Down Expand Up @@ -314,6 +330,8 @@ def create(
caching (e.g. what content to cache) and enjoy guaranteed cost savings.
Format:
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param agent: The agent to interact with.
:param agent_config: Configuration parameters for the agent interaction.
Expand Down Expand Up @@ -360,6 +378,8 @@ def create(
caching (e.g. what content to cache) and enjoy guaranteed cost savings.
Format:
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param agent: The agent to interact with.
:param agent_config: Configuration parameters for the agent interaction.
Expand Down Expand Up @@ -1484,6 +1504,8 @@ async def create(
environment: interactions.CreateModelInteractionEnvironmentParam = ...,
generation_config: interactions.GenerationConfigParam = ...,
cached_content: str = ...,
safety_settings: List[interactions.SafetySettingParam] = ...,
labels: Dict[str, str] = ...,
input: interactions.InteractionsInputParam,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
Expand Down Expand Up @@ -1514,6 +1536,8 @@ async def create(
caching (e.g. what content to cache) and enjoy guaranteed cost savings.
Format:
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
Expand Down Expand Up @@ -1541,6 +1565,8 @@ async def create(
environment: interactions.CreateModelInteractionEnvironmentParam = ...,
generation_config: interactions.GenerationConfigParam = ...,
cached_content: str = ...,
safety_settings: List[interactions.SafetySettingParam] = ...,
labels: Dict[str, str] = ...,
input: interactions.InteractionsInputParam,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
Expand Down Expand Up @@ -1571,6 +1597,8 @@ async def create(
caching (e.g. what content to cache) and enjoy guaranteed cost savings.
Format:
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
Expand All @@ -1597,6 +1625,8 @@ async def create(
response_format: interactions.CreateAgentInteractionResponseFormatParam = ...,
environment: interactions.CreateAgentInteractionEnvironmentParam = ...,
agent_config: interactions.CreateAgentInteractionAgentConfigParam = ...,
safety_settings: List[interactions.SafetySettingParam] = ...,
labels: Dict[str, str] = ...,
input: interactions.InteractionsInputParam,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
Expand All @@ -1622,6 +1652,8 @@ async def create(
:param response_format: Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
:param environment: The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.
:param agent_config: Configuration parameters for the agent interaction.
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
Expand All @@ -1648,6 +1680,8 @@ async def create(
response_format: interactions.CreateAgentInteractionResponseFormatParam = ...,
environment: interactions.CreateAgentInteractionEnvironmentParam = ...,
agent_config: interactions.CreateAgentInteractionAgentConfigParam = ...,
safety_settings: List[interactions.SafetySettingParam] = ...,
labels: Dict[str, str] = ...,
input: interactions.InteractionsInputParam,
extra_headers: Optional[Mapping[str, str]] = None,
extra_query: Optional[Mapping[str, Any]] = None,
Expand All @@ -1673,6 +1707,8 @@ async def create(
:param response_format: Enforces that the generated response is a JSON object that complies with the JSON schema specified in this field.
:param environment: The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID.
:param agent_config: Configuration parameters for the agent interaction.
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param extra_headers: Additional headers to set or replace on requests.
:param extra_query: Additional query parameters to append to requests.
Expand Down Expand Up @@ -1718,6 +1754,8 @@ async def create(
caching (e.g. what content to cache) and enjoy guaranteed cost savings.
Format:
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param agent: The agent to interact with.
:param agent_config: Configuration parameters for the agent interaction.
Expand Down Expand Up @@ -1764,6 +1802,8 @@ async def create(
caching (e.g. what content to cache) and enjoy guaranteed cost savings.
Format:
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
:param safety_settings: Safety settings for the interaction.
:param labels: The labels with user-defined metadata for the request.
:param input: The input for the interaction.
:param agent: The agent to interact with.
:param agent_config: Configuration parameters for the agent interaction.
Expand Down
2 changes: 2 additions & 0 deletions google/genai/_gaos/resources/interactions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
from . import googlemapsresultstep
from . import googlesearchcallstep
from . import googlesearchresultstep
from . import interaction
from . import interactioncompletedevent
from . import interactioncreatedevent
from . import interactionstatusupdate
Expand Down Expand Up @@ -204,6 +205,7 @@
"googlemapsresultstep",
"googlesearchcallstep",
"googlesearchresultstep",
"interaction",
"interactioncompletedevent",
"interactioncreatedevent",
"interactionstatusupdate",
Expand Down
21 changes: 21 additions & 0 deletions google/genai/_gaos/resources/interactions/interaction/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2026 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.
#
# pyformat: disable

"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from ....types.interactions.safetysetting import SafetySetting

__all__ = ["SafetySetting"]
17 changes: 17 additions & 0 deletions google/genai/_gaos/types/interactions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,13 @@
from .responsemodality import ResponseModality
from .retrieval import Retrieval, RetrievalParam, RetrievalType
from .reviewsnippet import ReviewSnippet, ReviewSnippetParam
from .safetysetting import (
Method,
SafetySetting,
SafetySettingParam,
SafetySettingType,
Threshold,
)
from .servicetier import ServiceTier
from .source import Source, SourceParam, SourceType
from .speechconfig import SpeechConfig, SpeechConfigParam
Expand Down Expand Up @@ -583,6 +590,7 @@
"MCPServerToolResultStepResultUnion",
"MCPServerToolResultStepResultUnionParam",
"MediaResolution",
"Method",
"ModalityTokens",
"ModalityTokensTypedDict",
"Model",
Expand Down Expand Up @@ -611,6 +619,9 @@
"RetrievalType",
"ReviewSnippet",
"ReviewSnippetParam",
"SafetySetting",
"SafetySettingParam",
"SafetySettingType",
"ServiceTier",
"Source",
"SourceParam",
Expand Down Expand Up @@ -653,6 +664,7 @@
"ThoughtSummaryContentParam",
"ThoughtSummaryDelta",
"ThoughtSummaryDeltaTypedDict",
"Threshold",
"Tool",
"ToolChoice",
"ToolChoiceConfig",
Expand Down Expand Up @@ -960,6 +972,11 @@
"RetrievalType": ".retrieval",
"ReviewSnippet": ".reviewsnippet",
"ReviewSnippetParam": ".reviewsnippet",
"Method": ".safetysetting",
"SafetySetting": ".safetysetting",
"SafetySettingParam": ".safetysetting",
"SafetySettingType": ".safetysetting",
"Threshold": ".safetysetting",
"ServiceTier": ".servicetier",
"Source": ".source",
"SourceParam": ".source",
Expand Down
15 changes: 14 additions & 1 deletion google/genai/_gaos/types/interactions/createagentinteraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
from .interactionsinput import InteractionsInput, InteractionsInputParam
from .responseformat import ResponseFormat, ResponseFormatParam
from .responsemodality import ResponseModality
from .safetysetting import SafetySetting, SafetySettingParam
from .servicetier import ServiceTier
from .tool import Tool, ToolParam
from .webhookconfig import WebhookConfig, WebhookConfigParam
import pydantic
from pydantic import Field, model_serializer
from typing import List, Optional, Union
from typing import Dict, List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


Expand Down Expand Up @@ -107,6 +108,10 @@ class CreateAgentInteractionParam(TypedDict):
r"""The environment configuration for the interaction. Can be an object specifying remote environment sources or a string referencing an existing environment ID."""
agent_config: NotRequired[CreateAgentInteractionAgentConfigParam]
r"""Configuration parameters for the agent interaction."""
safety_settings: NotRequired[List[SafetySettingParam]]
r"""Safety settings for the interaction."""
labels: NotRequired[Dict[str, str]]
r"""The labels with user-defined metadata for the request."""


class CreateAgentInteraction(BaseModel):
Expand Down Expand Up @@ -161,6 +166,12 @@ class CreateAgentInteraction(BaseModel):
agent_config: Optional[CreateAgentInteractionAgentConfig] = None
r"""Configuration parameters for the agent interaction."""

safety_settings: Optional[List[SafetySetting]] = None
r"""Safety settings for the interaction."""

labels: Optional[Dict[str, str]] = None
r"""The labels with user-defined metadata for the request."""

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
Expand All @@ -178,6 +189,8 @@ def serialize_model(self, handler):
"response_format",
"environment",
"agent_config",
"safety_settings",
"labels",
]
)
serialized = handler(self)
Expand Down
15 changes: 14 additions & 1 deletion google/genai/_gaos/types/interactions/createmodelinteraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
from .model import Model
from .responseformat import ResponseFormat, ResponseFormatParam
from .responsemodality import ResponseModality
from .safetysetting import SafetySetting, SafetySettingParam
from .servicetier import ServiceTier
from .tool import Tool, ToolParam
from .webhookconfig import WebhookConfig, WebhookConfigParam
import pydantic
from pydantic import model_serializer
from typing import List, Optional, Union
from typing import Dict, List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


Expand Down Expand Up @@ -97,6 +98,10 @@ class CreateModelInteractionParam(TypedDict):
Format:
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
"""
safety_settings: NotRequired[List[SafetySettingParam]]
r"""Safety settings for the interaction."""
labels: NotRequired[Dict[str, str]]
r"""The labels with user-defined metadata for the request."""


class CreateModelInteraction(BaseModel):
Expand Down Expand Up @@ -159,6 +164,12 @@ class CreateModelInteraction(BaseModel):
`projects/{project}/locations/{location}/cachedContents/{cachedContent}`
"""

safety_settings: Optional[List[SafetySetting]] = None
r"""Safety settings for the interaction."""

labels: Optional[Dict[str, str]] = None
r"""The labels with user-defined metadata for the request."""

@model_serializer(mode="wrap")
def _serialize_model(self, handler):
optional_fields = set(
Expand All @@ -177,6 +188,8 @@ def _serialize_model(self, handler):
"environment",
"generation_config",
"cached_content",
"safety_settings",
"labels",
]
)
serialized = handler(self)
Expand Down
Loading
Loading