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
4 changes: 4 additions & 0 deletions google/genai/_gaos/resources/interactions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from ...types.interactions.codeexecutioncallarguments import CodeExecutionCallArguments
from ...types.interactions.codeexecutioncallstep import CodeExecutionCallStep
from ...types.interactions.codeexecutionresultstep import CodeExecutionResultStep
from ...types.interactions.codemenderagentconfig import CodeMenderAgentConfig
from ...types.interactions.content import Content
from ...types.interactions.createagentinteraction import (
CreateAgentInteractionParam as CreateAgentInteractionParamsNonStreaming,
Expand Down Expand Up @@ -103,6 +104,7 @@
from ...types.interactions.videoresponseformat import VideoResponseFormat
from ...types.interactions.webhookconfig import WebhookConfig
from . import codeexecutioncallstep
from . import codemenderagentconfig
from . import environment
from . import errorevent
from . import googlemapscallstep
Expand Down Expand Up @@ -134,6 +136,7 @@
"CodeExecutionCallArguments",
"CodeExecutionCallStep",
"CodeExecutionResultStep",
"CodeMenderAgentConfig",
"Content",
"CreateAgentInteractionParamsNonStreaming",
"CreateAgentInteractionParamsStreaming",
Expand Down Expand Up @@ -204,6 +207,7 @@
"VideoResponseFormat",
"WebhookConfig",
"codeexecutioncallstep",
"codemenderagentconfig",
"environment",
"errorevent",
"googlemapscallstep",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.findrequest import FindRequest
from ....types.interactions.fixrequest import FixRequest
from ....types.interactions.sessionconfig import SessionConfig
from . import findrequest
from . import fixrequest

__all__ = ["FindRequest", "FixRequest", "SessionConfig", "findrequest", "fixrequest"]
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.filecontent import FileContent as SourceFile

__all__ = ["SourceFile"]
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.filecontent import FileContent as SourceFile

__all__ = ["SourceFile"]
27 changes: 27 additions & 0 deletions google/genai/_gaos/types/interactions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
CodeExecutionResultStep,
CodeExecutionResultStepParam,
)
from .codemenderagentconfig import CodeMenderAgentConfig, CodeMenderAgentConfigParam
from .computeruse import (
ComputerUse,
ComputerUseParam,
Expand Down Expand Up @@ -113,6 +114,7 @@
from .errorevent import ErrorEvent, ErrorEventTypedDict
from .exaaisearchconfig import ExaAISearchConfig, ExaAISearchConfigParam
from .filecitation import FileCitation, FileCitationParam
from .filecontent import FileContent, FileContentParam
from .filesearch import FileSearch, FileSearchParam
from .filesearchcalldelta import FileSearchCallDelta, FileSearchCallDeltaTypedDict
from .filesearchcallstep import FileSearchCallStep, FileSearchCallStepParam
Expand All @@ -123,6 +125,8 @@
)
from .filesearchresultstep import FileSearchResultStep, FileSearchResultStepParam
from .filter_ import Filter, FilterParam
from .findrequest import FindRequest, FindRequestParam, Mode
from .fixrequest import FixRequest, FixRequestParam
from .function import Function, FunctionParam
from .functioncallstep import FunctionCallStep, FunctionCallStepParam
from .functionresultdelta import (
Expand Down Expand Up @@ -307,6 +311,7 @@
)
from .reviewsnippet import ReviewSnippet, ReviewSnippetParam
from .servicetier import ServiceTier
from .sessionconfig import SessionConfig, SessionConfigParam
from .source import Source, SourceParam, SourceType
from .speechconfig import SpeechConfig, SpeechConfigParam
from .status import Status, StatusParam
Expand Down Expand Up @@ -412,6 +417,8 @@
"CodeExecutionResultDeltaTypedDict",
"CodeExecutionResultStep",
"CodeExecutionResultStepParam",
"CodeMenderAgentConfig",
"CodeMenderAgentConfigParam",
"ComputerUse",
"ComputerUseParam",
"Content",
Expand Down Expand Up @@ -457,6 +464,8 @@
"ExaAISearchConfigParam",
"FileCitation",
"FileCitationParam",
"FileContent",
"FileContentParam",
"FileSearch",
"FileSearchCallDelta",
"FileSearchCallDeltaTypedDict",
Expand All @@ -471,6 +480,10 @@
"FileSearchResultTypedDict",
"Filter",
"FilterParam",
"FindRequest",
"FindRequestParam",
"FixRequest",
"FixRequestParam",
"Function",
"FunctionCallStep",
"FunctionCallStepParam",
Expand Down Expand Up @@ -591,6 +604,7 @@
"MediaResolution",
"ModalityTokens",
"ModalityTokensTypedDict",
"Mode",
"Model",
"ModelOutputStep",
"ModelOutputStepParam",
Expand Down Expand Up @@ -625,6 +639,8 @@
"ReviewSnippet",
"ReviewSnippetParam",
"ServiceTier",
"SessionConfig",
"SessionConfigParam",
"Source",
"SourceParam",
"SourceType",
Expand Down Expand Up @@ -760,6 +776,8 @@
"CodeExecutionResultDeltaTypedDict": ".codeexecutionresultdelta",
"CodeExecutionResultStep": ".codeexecutionresultstep",
"CodeExecutionResultStepParam": ".codeexecutionresultstep",
"CodeMenderAgentConfig": ".codemenderagentconfig",
"CodeMenderAgentConfigParam": ".codemenderagentconfig",
"ComputerUse": ".computeruse",
"ComputerUseParam": ".computeruse",
"DisabledSafetyPolicy": ".computeruse",
Expand Down Expand Up @@ -812,6 +830,8 @@
"ExaAISearchConfigParam": ".exaaisearchconfig",
"FileCitation": ".filecitation",
"FileCitationParam": ".filecitation",
"FileContent": ".filecontent",
"FileContentParam": ".filecontent",
"FileSearch": ".filesearch",
"FileSearchParam": ".filesearch",
"FileSearchCallDelta": ".filesearchcalldelta",
Expand All @@ -826,6 +846,11 @@
"FileSearchResultStepParam": ".filesearchresultstep",
"Filter": ".filter_",
"FilterParam": ".filter_",
"FindRequest": ".findrequest",
"FindRequestParam": ".findrequest",
"Mode": ".findrequest",
"FixRequest": ".fixrequest",
"FixRequestParam": ".fixrequest",
"Function": ".function",
"FunctionParam": ".function",
"FunctionCallStep": ".functioncallstep",
Expand Down Expand Up @@ -981,6 +1006,8 @@
"ReviewSnippet": ".reviewsnippet",
"ReviewSnippetParam": ".reviewsnippet",
"ServiceTier": ".servicetier",
"SessionConfig": ".sessionconfig",
"SessionConfigParam": ".sessionconfig",
"Source": ".source",
"SourceParam": ".source",
"SourceType": ".source",
Expand Down
111 changes: 111 additions & 0 deletions google/genai/_gaos/types/interactions/codemenderagentconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# 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 __future__ import annotations
from .. import BaseModel, UNSET_SENTINEL
from ...utils import validate_const
from .findrequest import FindRequest, FindRequestParam
from .fixrequest import FixRequest, FixRequestParam
from .sessionconfig import SessionConfig, SessionConfigParam
import pydantic
from pydantic import model_serializer
from pydantic.functional_validators import AfterValidator
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class CodeMenderAgentConfigParam(TypedDict):
r"""Configuration for the CodeMender agent."""

type: Literal["code-mender"]
find_request: NotRequired[FindRequestParam]
r"""Request parameters specific to FIND sessions, used for discovering
vulnerabilities in a codebase.
"""
fix_request: NotRequired[FixRequestParam]
r"""Request parameters specific to FIX sessions, used for generating and
validating security patches.
"""
session_id: NotRequired[str]
r"""Parameter for grouping multiple interactions that belong to
the same CodeMender session.
"""
session_config: NotRequired[SessionConfigParam]
r"""The configuration of CodeMender sessions."""
model: NotRequired[str]
r"""The name of the model to use for the CodeMender agent. One
CodeMender session will only use one model.
"""


class CodeMenderAgentConfig(BaseModel):
r"""Configuration for the CodeMender agent."""

type: Annotated[
Annotated[
Literal["code-mender"], AfterValidator(validate_const("code-mender"))
],
pydantic.Field(alias="type"),
] = "code-mender"

find_request: Optional[FindRequest] = None
r"""Request parameters specific to FIND sessions, used for discovering
vulnerabilities in a codebase.
"""

fix_request: Optional[FixRequest] = None
r"""Request parameters specific to FIX sessions, used for generating and
validating security patches.
"""

session_id: Optional[str] = None
r"""Parameter for grouping multiple interactions that belong to
the same CodeMender session.
"""

session_config: Optional[SessionConfig] = None
r"""The configuration of CodeMender sessions."""

model: Optional[str] = None
r"""The name of the model to use for the CodeMender agent. One
CodeMender session will only use one model.
"""

@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(
["find_request", "fix_request", "session_id", "session_config", "model"]
)
serialized = handler(self)
m = {}

for n, f in type(self).model_fields.items():
k = f.alias or n
val = serialized.get(k, serialized.get(n))

if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val

return m


try:
CodeMenderAgentConfig.model_rebuild()
except NameError:
pass
10 changes: 8 additions & 2 deletions google/genai/_gaos/types/interactions/createagentinteraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from __future__ import annotations
from .. import BaseModel, UNSET_SENTINEL
from .agentoption import AgentOption
from .codemenderagentconfig import CodeMenderAgentConfig, CodeMenderAgentConfigParam
from .deepresearchagentconfig import (
DeepResearchAgentConfig,
DeepResearchAgentConfigParam,
Expand Down Expand Up @@ -64,13 +65,18 @@

CreateAgentInteractionAgentConfigParam = TypeAliasType(
"CreateAgentInteractionAgentConfigParam",
Union[DynamicAgentConfigParam, DeepResearchAgentConfigParam],
Union[
DynamicAgentConfigParam,
DeepResearchAgentConfigParam,
CodeMenderAgentConfigParam,
],
)
r"""Configuration parameters for the agent interaction."""


CreateAgentInteractionAgentConfig = Annotated[
Union[DynamicAgentConfig, DeepResearchAgentConfig], Field(discriminator="type")
Union[DynamicAgentConfig, DeepResearchAgentConfig, CodeMenderAgentConfig],
Field(discriminator="type"),
]
r"""Configuration parameters for the agent interaction."""

Expand Down
Loading
Loading