Skip to content

Commit b491aed

Browse files
wanlin31copybara-github
authored andcommitted
chore: internal structure change
PiperOrigin-RevId: 929505643
1 parent 176f247 commit b491aed

7 files changed

Lines changed: 383 additions & 307 deletions

File tree

google/genai/_interactions/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@
3333
from .tool_param import ToolParam as ToolParam
3434
from .environment import Environment as Environment
3535
from .error_event import ErrorEvent as ErrorEvent
36+
from .fix_request import FixRequest as FixRequest
3637
from .interaction import Interaction as Interaction
3738
from .model_param import ModelParam as ModelParam
3839
from .usage_param import UsageParam as UsageParam
40+
from .find_request import FindRequest as FindRequest
3941
from .image_config import ImageConfig as ImageConfig
4042
from .text_content import TextContent as TextContent
4143
from .thought_step import ThoughtStep as ThoughtStep
@@ -58,8 +60,10 @@
5860
from .tool_choice_type import ToolChoiceType as ToolChoiceType
5961
from .agent_list_params import AgentListParams as AgentListParams
6062
from .environment_param import EnvironmentParam as EnvironmentParam
63+
from .fix_request_param import FixRequestParam as FixRequestParam
6164
from .generation_config import GenerationConfig as GenerationConfig
6265
from .model_output_step import ModelOutputStep as ModelOutputStep
66+
from .find_request_param import FindRequestParam as FindRequestParam
6367
from .function_call_step import FunctionCallStep as FunctionCallStep
6468
from .google_maps_result import GoogleMapsResult as GoogleMapsResult
6569
from .image_config_param import ImageConfigParam as ImageConfigParam
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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 List, Optional
19+
from typing_extensions import Literal
20+
21+
from .._models import BaseModel
22+
23+
__all__ = ["FindRequest", "SessionConfig", "SourceFile"]
24+
25+
26+
class SessionConfig(BaseModel):
27+
"""
28+
Optional session-specific configurations to override default agent
29+
behavior.
30+
"""
31+
32+
max_rounds: Optional[int] = None
33+
"""
34+
The maximum number of interaction rounds the agent is allowed to perform before
35+
reaching a timeout.
36+
"""
37+
38+
pipeline_mode: Optional[Literal["scan", "verify"]] = None
39+
"""The pipeline mode of a CodeMender session.
40+
41+
It can only be used for a find session.
42+
"""
43+
44+
topology: Optional[str] = None
45+
"""The cognitive architecture or "thinking" topology used by the agent (e.g.
46+
47+
"default", "deep").
48+
"""
49+
50+
51+
class SourceFile(BaseModel):
52+
"""Content of a single file in the codebase."""
53+
54+
content: Optional[str] = None
55+
"""The UTF-8 encoded text content of the file."""
56+
57+
path: Optional[str] = None
58+
"""The relative path of the file from the project root."""
59+
60+
61+
class FindRequest(BaseModel):
62+
"""
63+
Request parameters specific to FIND sessions, used for discovering
64+
vulnerabilities in a codebase.
65+
"""
66+
67+
request: Literal["find_request"]
68+
69+
description: Optional[str] = None
70+
"""
71+
Additional context or custom instructions provided by the user to guide the
72+
vulnerability analysis.
73+
"""
74+
75+
finding_id: Optional[str] = None
76+
"""The identifier of a specific finding to verify.
77+
78+
This is primarily used in VERIFY mode to focus the agent's execution-based
79+
validation on a single vulnerability.
80+
"""
81+
82+
session_config: Optional[SessionConfig] = None
83+
"""Optional session-specific configurations to override default agent behavior."""
84+
85+
session_id: Optional[str] = None
86+
"""
87+
Parameter for grouping multiple interactions that belong to the same CodeMender
88+
session.
89+
"""
90+
91+
source_files: Optional[List[SourceFile]] = None
92+
"""A list of source files to provide as context for the scan."""
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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 __future__ import annotations
19+
20+
from typing import Iterable
21+
from typing_extensions import Literal, Required, TypedDict
22+
23+
__all__ = ["FindRequestParam", "SessionConfig", "SourceFile"]
24+
25+
26+
class SessionConfig(TypedDict, total=False):
27+
"""
28+
Optional session-specific configurations to override default agent
29+
behavior.
30+
"""
31+
32+
max_rounds: int
33+
"""
34+
The maximum number of interaction rounds the agent is allowed to perform before
35+
reaching a timeout.
36+
"""
37+
38+
pipeline_mode: Literal["scan", "verify"]
39+
"""The pipeline mode of a CodeMender session.
40+
41+
It can only be used for a find session.
42+
"""
43+
44+
topology: str
45+
"""The cognitive architecture or "thinking" topology used by the agent (e.g.
46+
47+
"default", "deep").
48+
"""
49+
50+
51+
class SourceFile(TypedDict, total=False):
52+
"""Content of a single file in the codebase."""
53+
54+
content: str
55+
"""The UTF-8 encoded text content of the file."""
56+
57+
path: str
58+
"""The relative path of the file from the project root."""
59+
60+
61+
class FindRequestParam(TypedDict, total=False):
62+
"""
63+
Request parameters specific to FIND sessions, used for discovering
64+
vulnerabilities in a codebase.
65+
"""
66+
67+
request: Required[Literal["find_request"]]
68+
69+
description: str
70+
"""
71+
Additional context or custom instructions provided by the user to guide the
72+
vulnerability analysis.
73+
"""
74+
75+
finding_id: str
76+
"""The identifier of a specific finding to verify.
77+
78+
This is primarily used in VERIFY mode to focus the agent's execution-based
79+
validation on a single vulnerability.
80+
"""
81+
82+
session_config: SessionConfig
83+
"""Optional session-specific configurations to override default agent behavior."""
84+
85+
session_id: str
86+
"""
87+
Parameter for grouping multiple interactions that belong to the same CodeMender
88+
session.
89+
"""
90+
91+
source_files: Iterable[SourceFile]
92+
"""A list of source files to provide as context for the scan."""
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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 List, Optional
19+
from typing_extensions import Literal
20+
21+
from .._models import BaseModel
22+
23+
__all__ = ["FixRequest", "SessionConfig", "SourceFile"]
24+
25+
26+
class SessionConfig(BaseModel):
27+
"""
28+
Optional session-specific configurations to override default agent
29+
behavior.
30+
"""
31+
32+
max_rounds: Optional[int] = None
33+
"""
34+
The maximum number of interaction rounds the agent is allowed to perform before
35+
reaching a timeout.
36+
"""
37+
38+
pipeline_mode: Optional[Literal["scan", "verify"]] = None
39+
"""The pipeline mode of a CodeMender session.
40+
41+
It can only be used for a find session.
42+
"""
43+
44+
topology: Optional[str] = None
45+
"""The cognitive architecture or "thinking" topology used by the agent (e.g.
46+
47+
"default", "deep").
48+
"""
49+
50+
51+
class SourceFile(BaseModel):
52+
"""Content of a single file in the codebase."""
53+
54+
content: Optional[str] = None
55+
"""The UTF-8 encoded text content of the file."""
56+
57+
path: Optional[str] = None
58+
"""The relative path of the file from the project root."""
59+
60+
61+
class FixRequest(BaseModel):
62+
"""
63+
Request parameters specific to FIX sessions, used for generating and
64+
validating security patches.
65+
"""
66+
67+
request: Literal["fix_request"]
68+
69+
description: Optional[str] = None
70+
"""
71+
Additional context or custom instructions provided by the user to guide the
72+
patch generation process.
73+
"""
74+
75+
finding_id: Optional[str] = None
76+
"""The identifier of the specific security finding to be remediated.
77+
78+
This ID maps to a previously discovered vulnerability.
79+
"""
80+
81+
session_config: Optional[SessionConfig] = None
82+
"""Optional session-specific configurations to override default agent behavior."""
83+
84+
session_id: Optional[str] = None
85+
"""
86+
Parameter for grouping multiple interactions that belong to the same CodeMender
87+
session.
88+
"""
89+
90+
source_files: Optional[List[SourceFile]] = None
91+
"""A list of source files providing context for the remediation.
92+
93+
These files are typically the ones containing the identified vulnerability.
94+
"""
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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 __future__ import annotations
19+
20+
from typing import Iterable
21+
from typing_extensions import Literal, Required, TypedDict
22+
23+
__all__ = ["FixRequestParam", "SessionConfig", "SourceFile"]
24+
25+
26+
class SessionConfig(TypedDict, total=False):
27+
"""
28+
Optional session-specific configurations to override default agent
29+
behavior.
30+
"""
31+
32+
max_rounds: int
33+
"""
34+
The maximum number of interaction rounds the agent is allowed to perform before
35+
reaching a timeout.
36+
"""
37+
38+
pipeline_mode: Literal["scan", "verify"]
39+
"""The pipeline mode of a CodeMender session.
40+
41+
It can only be used for a find session.
42+
"""
43+
44+
topology: str
45+
"""The cognitive architecture or "thinking" topology used by the agent (e.g.
46+
47+
"default", "deep").
48+
"""
49+
50+
51+
class SourceFile(TypedDict, total=False):
52+
"""Content of a single file in the codebase."""
53+
54+
content: str
55+
"""The UTF-8 encoded text content of the file."""
56+
57+
path: str
58+
"""The relative path of the file from the project root."""
59+
60+
61+
class FixRequestParam(TypedDict, total=False):
62+
"""
63+
Request parameters specific to FIX sessions, used for generating and
64+
validating security patches.
65+
"""
66+
67+
request: Required[Literal["fix_request"]]
68+
69+
description: str
70+
"""
71+
Additional context or custom instructions provided by the user to guide the
72+
patch generation process.
73+
"""
74+
75+
finding_id: str
76+
"""The identifier of the specific security finding to be remediated.
77+
78+
This ID maps to a previously discovered vulnerability.
79+
"""
80+
81+
session_config: SessionConfig
82+
"""Optional session-specific configurations to override default agent behavior."""
83+
84+
session_id: str
85+
"""
86+
Parameter for grouping multiple interactions that belong to the same CodeMender
87+
session.
88+
"""
89+
90+
source_files: Iterable[SourceFile]
91+
"""A list of source files providing context for the remediation.
92+
93+
These files are typically the ones containing the identified vulnerability.
94+
"""

0 commit comments

Comments
 (0)