|
| 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 | + """ |
0 commit comments