codemie-sdk-python 0.1.92__py3-none-any.whl → 0.1.258__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of codemie-sdk-python might be problematic. Click here for more details.
- codemie_sdk/__init__.py +114 -2
- codemie_sdk/auth/credentials.py +5 -4
- codemie_sdk/client/client.py +66 -5
- codemie_sdk/models/assistant.py +111 -8
- codemie_sdk/models/conversation.py +169 -0
- codemie_sdk/models/datasource.py +80 -1
- codemie_sdk/models/file_operation.py +25 -0
- codemie_sdk/models/integration.py +3 -1
- codemie_sdk/models/vendor_assistant.py +187 -0
- codemie_sdk/models/vendor_guardrail.py +152 -0
- codemie_sdk/models/vendor_knowledgebase.py +151 -0
- codemie_sdk/models/vendor_workflow.py +145 -0
- codemie_sdk/models/workflow.py +1 -1
- codemie_sdk/models/workflow_execution_payload.py +21 -0
- codemie_sdk/models/workflow_state.py +6 -3
- codemie_sdk/models/workflow_thoughts.py +26 -0
- codemie_sdk/services/assistant.py +220 -1
- codemie_sdk/services/conversation.py +90 -0
- codemie_sdk/services/datasource.py +67 -0
- codemie_sdk/services/files.py +82 -0
- codemie_sdk/services/vendor_assistant.py +364 -0
- codemie_sdk/services/vendor_guardrail.py +375 -0
- codemie_sdk/services/vendor_knowledgebase.py +270 -0
- codemie_sdk/services/vendor_workflow.py +330 -0
- codemie_sdk/services/webhook.py +41 -0
- codemie_sdk/services/workflow.py +26 -2
- codemie_sdk/services/workflow_execution.py +54 -6
- codemie_sdk/utils/http.py +43 -16
- codemie_sdk_python-0.1.258.dist-info/METADATA +1404 -0
- codemie_sdk_python-0.1.258.dist-info/RECORD +45 -0
- codemie_sdk_python-0.1.92.dist-info/METADATA +0 -892
- codemie_sdk_python-0.1.92.dist-info/RECORD +0 -30
- {codemie_sdk_python-0.1.92.dist-info → codemie_sdk_python-0.1.258.dist-info}/WHEEL +0 -0
codemie_sdk/models/datasource.py
CHANGED
|
@@ -25,6 +25,8 @@ class DataSourceType(str, Enum):
|
|
|
25
25
|
CHUNK_SUMMARY = "chunk-summary"
|
|
26
26
|
JSON = "knowledge_base_json"
|
|
27
27
|
BEDROCK = "knowledge_base_bedrock"
|
|
28
|
+
PLATFORM = "platform_marketplace_assistant"
|
|
29
|
+
AZURE_DEVOPS_WIKI = "knowledge_base_azure_devops_wiki"
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
class DataSourceStatus(str, Enum):
|
|
@@ -46,6 +48,15 @@ class DataSourceProcessingInfo(BaseModel):
|
|
|
46
48
|
processed_documents_count: Optional[int] = Field(None, alias="documents_count_key")
|
|
47
49
|
|
|
48
50
|
|
|
51
|
+
class ElasticsearchStatsResponse(BaseModel):
|
|
52
|
+
"""Response model for Elasticsearch index statistics."""
|
|
53
|
+
|
|
54
|
+
model_config = ConfigDict(extra="ignore")
|
|
55
|
+
|
|
56
|
+
index_name: str = Field(..., description="Name of the index in Elasticsearch")
|
|
57
|
+
size_in_bytes: int = Field(..., ge=0, description="Size of the index in bytes")
|
|
58
|
+
|
|
59
|
+
|
|
49
60
|
# Base request models
|
|
50
61
|
class Confluence(BaseModel):
|
|
51
62
|
"""Model for Confluence-specific response fields"""
|
|
@@ -89,6 +100,17 @@ class File(BaseModel):
|
|
|
89
100
|
model_config = ConfigDict(extra="ignore")
|
|
90
101
|
|
|
91
102
|
|
|
103
|
+
class AzureDevOpsWiki(BaseModel):
|
|
104
|
+
"""Model for Azure DevOps Wiki-specific response fields"""
|
|
105
|
+
|
|
106
|
+
wiki_query: Optional[str] = None
|
|
107
|
+
organization: Optional[str] = None
|
|
108
|
+
project: Optional[str] = None
|
|
109
|
+
wiki_name: Optional[str] = None
|
|
110
|
+
|
|
111
|
+
model_config = ConfigDict(extra="ignore")
|
|
112
|
+
|
|
113
|
+
|
|
92
114
|
class Code(BaseModel):
|
|
93
115
|
"""Model for code repository datasource creation"""
|
|
94
116
|
|
|
@@ -108,7 +130,7 @@ class BaseDataSourceRequest(BaseModel):
|
|
|
108
130
|
name: str = Field(
|
|
109
131
|
...,
|
|
110
132
|
description="Name must contain only lowercase letters and underscores.",
|
|
111
|
-
max_length=
|
|
133
|
+
max_length=50,
|
|
112
134
|
)
|
|
113
135
|
project_name: str
|
|
114
136
|
description: str = Field(..., max_length=100)
|
|
@@ -189,6 +211,17 @@ class FileDataSourceRequest(BaseDataSourceRequest):
|
|
|
189
211
|
super().__init__(type=DataSourceType.FILE, **data)
|
|
190
212
|
|
|
191
213
|
|
|
214
|
+
class AzureDevOpsWikiDataSourceRequest(BaseDataSourceRequest, AzureDevOpsWiki):
|
|
215
|
+
"""Model for Azure DevOps Wiki datasource creation requests"""
|
|
216
|
+
|
|
217
|
+
def __init__(self, **data):
|
|
218
|
+
super().__init__(type=DataSourceType.AZURE_DEVOPS_WIKI, **data)
|
|
219
|
+
|
|
220
|
+
@classmethod
|
|
221
|
+
def required_fields(cls) -> List[str]:
|
|
222
|
+
return ["wiki_query"]
|
|
223
|
+
|
|
224
|
+
|
|
192
225
|
class BaseUpdateDataSourceRequest(BaseDataSourceRequest):
|
|
193
226
|
"""Mixin update-specific reindex fields"""
|
|
194
227
|
|
|
@@ -259,6 +292,49 @@ class UpdateFileDataSourceRequest(BaseUpdateDataSourceRequest):
|
|
|
259
292
|
super().__init__(type=DataSourceType.FILE, **data)
|
|
260
293
|
|
|
261
294
|
|
|
295
|
+
class UpdateAzureDevOpsWikiDataSourceRequest(
|
|
296
|
+
BaseUpdateDataSourceRequest, AzureDevOpsWiki
|
|
297
|
+
):
|
|
298
|
+
"""Model for Azure DevOps Wiki datasource updates"""
|
|
299
|
+
|
|
300
|
+
def __init__(self, **data):
|
|
301
|
+
super().__init__(type=DataSourceType.AZURE_DEVOPS_WIKI, **data)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
class CodeAnalysisDataSourceRequest(BaseModel):
|
|
305
|
+
"""Model for provider-based datasource creation requests"""
|
|
306
|
+
|
|
307
|
+
model_config = ConfigDict(extra="ignore", populate_by_name=True)
|
|
308
|
+
|
|
309
|
+
name: str = Field(..., description="Datasource name")
|
|
310
|
+
description: Optional[str] = Field(None, description="Datasource description")
|
|
311
|
+
project_name: str = Field(..., description="Project name")
|
|
312
|
+
project_space_visible: bool = Field(False, alias="projectSpaceVisible")
|
|
313
|
+
branch: Optional[str] = Field(None, description="Git branch")
|
|
314
|
+
api_url: str = Field(..., description="Repository URL")
|
|
315
|
+
access_token: str = Field(..., description="Access token for repository")
|
|
316
|
+
analyzer: Optional[str] = Field(
|
|
317
|
+
None, description="Code analyzer type (e.g., Java, Python)"
|
|
318
|
+
)
|
|
319
|
+
datasource_root: str = Field("/", description="Root directory to analyze")
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
class CodeExplorationDataSourceRequest(BaseModel):
|
|
323
|
+
"""Model for CodeExplorationToolkit datasource creation requests"""
|
|
324
|
+
|
|
325
|
+
model_config = ConfigDict(extra="ignore", populate_by_name=True)
|
|
326
|
+
|
|
327
|
+
name: str = Field(..., description="Datasource name")
|
|
328
|
+
description: Optional[str] = Field(None, description="Datasource description")
|
|
329
|
+
project_name: str = Field(..., description="Project name")
|
|
330
|
+
project_space_visible: bool = Field(False, alias="projectSpaceVisible")
|
|
331
|
+
code_analysis_datasource_ids: List[str] = Field(
|
|
332
|
+
...,
|
|
333
|
+
alias="code_analysis_datasource_ids",
|
|
334
|
+
description="List of CodeAnalysisToolkit datasource IDs",
|
|
335
|
+
)
|
|
336
|
+
|
|
337
|
+
|
|
262
338
|
class DataSource(BaseModel):
|
|
263
339
|
model_config = ConfigDict(
|
|
264
340
|
extra="ignore",
|
|
@@ -293,6 +369,8 @@ class DataSource(BaseModel):
|
|
|
293
369
|
confluence: Optional[Confluence] = None
|
|
294
370
|
# Google doc specific fields
|
|
295
371
|
google_doc_link: Optional[str] = None
|
|
372
|
+
# Azure DevOps Wiki specific fields
|
|
373
|
+
azure_devops_wiki: Optional[AzureDevOpsWiki] = None
|
|
296
374
|
|
|
297
375
|
@model_validator(mode="before")
|
|
298
376
|
def before_init(cls, values):
|
|
@@ -309,6 +387,7 @@ class DataSource(BaseModel):
|
|
|
309
387
|
DataSourceType.CONFLUENCE,
|
|
310
388
|
DataSourceType.JIRA,
|
|
311
389
|
DataSourceType.GOOGLE,
|
|
390
|
+
DataSourceType.AZURE_DEVOPS_WIKI,
|
|
312
391
|
]:
|
|
313
392
|
complete_state = values.get("complete_state", 0)
|
|
314
393
|
if complete_state is not None:
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""File operation models."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional, List, Any, Dict
|
|
4
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class FileResponse(BaseModel):
|
|
8
|
+
"""Individual file response model."""
|
|
9
|
+
|
|
10
|
+
model_config = ConfigDict(extra="ignore")
|
|
11
|
+
|
|
12
|
+
file_url: str = Field(..., description="URL or identifier for the uploaded file")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class FileBulkCreateResponse(BaseModel):
|
|
16
|
+
"""Response model for bulk file creation."""
|
|
17
|
+
|
|
18
|
+
model_config = ConfigDict(extra="ignore")
|
|
19
|
+
|
|
20
|
+
files: List[FileResponse] = Field(
|
|
21
|
+
..., description="List of successfully uploaded files with their URLs"
|
|
22
|
+
)
|
|
23
|
+
failed_files: Optional[List[Dict[str, Any]]] = Field(
|
|
24
|
+
None, description="List of files that failed to upload, null if no failures"
|
|
25
|
+
)
|
|
@@ -29,12 +29,14 @@ class CredentialTypes(str, Enum):
|
|
|
29
29
|
SONAR = "Sonar"
|
|
30
30
|
SQL = "SQL"
|
|
31
31
|
TELEGRAM = "Telegram"
|
|
32
|
-
|
|
32
|
+
ZEPHYR_SCALE = "ZephyrScale"
|
|
33
33
|
ZEPHYR_SQUAD = "ZephyrSquad"
|
|
34
34
|
SERVICE_NOW = "ServiceNow"
|
|
35
35
|
DIAL = "DIAL"
|
|
36
36
|
A2A = "A2A"
|
|
37
37
|
MCP = "MCP"
|
|
38
|
+
LITE_LLM = "LiteLLM"
|
|
39
|
+
REPORT_PORTAL = "ReportPortal"
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
class IntegrationType(str, Enum):
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"""Models for vendor assistant settings."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Optional, List
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class VendorType(str, Enum):
|
|
11
|
+
"""Supported cloud vendor types."""
|
|
12
|
+
|
|
13
|
+
AWS = "aws"
|
|
14
|
+
AZURE = "azure"
|
|
15
|
+
GCP = "gcp"
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class VendorAssistantStatus(str, Enum):
|
|
19
|
+
"""Status of vendor assistant."""
|
|
20
|
+
|
|
21
|
+
PREPARED = "PREPARED"
|
|
22
|
+
NOT_PREPARED = "NOT_PREPARED"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class VendorAssistantSetting(BaseModel):
|
|
26
|
+
"""Model representing a vendor assistant setting."""
|
|
27
|
+
|
|
28
|
+
model_config = ConfigDict(extra="ignore")
|
|
29
|
+
|
|
30
|
+
setting_id: str = Field(..., description="Unique identifier for the setting")
|
|
31
|
+
setting_name: str = Field(..., description="Name of the setting")
|
|
32
|
+
project: str = Field(..., description="Project associated with the setting")
|
|
33
|
+
entities: List[str] = Field(
|
|
34
|
+
default_factory=list, description="List of entities associated with the setting"
|
|
35
|
+
)
|
|
36
|
+
invalid: Optional[bool] = Field(None, description="Whether the setting is invalid")
|
|
37
|
+
error: Optional[str] = Field(
|
|
38
|
+
None, description="Error message if the setting is invalid"
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class PaginationInfo(BaseModel):
|
|
43
|
+
"""Pagination information for list responses."""
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(extra="ignore")
|
|
46
|
+
|
|
47
|
+
total: int = Field(..., description="Total number of items")
|
|
48
|
+
pages: int = Field(..., description="Total number of pages")
|
|
49
|
+
page: int = Field(..., description="Current page number (0-based)")
|
|
50
|
+
per_page: int = Field(..., description="Number of items per page")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class VendorAssistantSettingsResponse(BaseModel):
|
|
54
|
+
"""Response model for vendor assistant settings list."""
|
|
55
|
+
|
|
56
|
+
model_config = ConfigDict(extra="ignore")
|
|
57
|
+
|
|
58
|
+
data: List[VendorAssistantSetting] = Field(
|
|
59
|
+
..., description="List of vendor assistant settings"
|
|
60
|
+
)
|
|
61
|
+
pagination: PaginationInfo = Field(..., description="Pagination information")
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class VendorAssistant(BaseModel):
|
|
65
|
+
"""Model representing a vendor assistant."""
|
|
66
|
+
|
|
67
|
+
model_config = ConfigDict(extra="ignore")
|
|
68
|
+
|
|
69
|
+
id: str = Field(..., description="Unique identifier for the assistant")
|
|
70
|
+
name: str = Field(..., description="Name of the assistant")
|
|
71
|
+
status: VendorAssistantStatus = Field(..., description="Status of the assistant")
|
|
72
|
+
description: Optional[str] = Field(None, description="Description of the assistant")
|
|
73
|
+
updatedAt: datetime = Field(
|
|
74
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class VendorAssistantVersion(BaseModel):
|
|
79
|
+
"""Model representing a specific version of a vendor assistant with detailed information."""
|
|
80
|
+
|
|
81
|
+
model_config = ConfigDict(extra="ignore")
|
|
82
|
+
|
|
83
|
+
id: str = Field(..., description="Unique identifier for the assistant")
|
|
84
|
+
name: str = Field(..., description="Name of the assistant")
|
|
85
|
+
status: VendorAssistantStatus = Field(..., description="Status of the assistant")
|
|
86
|
+
version: str = Field(..., description="Version of the assistant")
|
|
87
|
+
instruction: str = Field(..., description="Instructions for the assistant")
|
|
88
|
+
foundationModel: str = Field(
|
|
89
|
+
...,
|
|
90
|
+
description="ARN or identifier of the foundation model",
|
|
91
|
+
alias="foundationModel",
|
|
92
|
+
)
|
|
93
|
+
description: Optional[str] = Field(None, description="Description of the assistant")
|
|
94
|
+
createdAt: datetime = Field(
|
|
95
|
+
..., description="Creation timestamp", alias="createdAt"
|
|
96
|
+
)
|
|
97
|
+
updatedAt: datetime = Field(
|
|
98
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class TokenPagination(BaseModel):
|
|
103
|
+
"""Token-based pagination information."""
|
|
104
|
+
|
|
105
|
+
model_config = ConfigDict(extra="ignore")
|
|
106
|
+
|
|
107
|
+
next_token: Optional[str] = Field(None, description="Token for the next page")
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class VendorAssistantsResponse(BaseModel):
|
|
111
|
+
"""Response model for vendor assistants list."""
|
|
112
|
+
|
|
113
|
+
model_config = ConfigDict(extra="ignore")
|
|
114
|
+
|
|
115
|
+
data: List[VendorAssistant] = Field(..., description="List of vendor assistants")
|
|
116
|
+
pagination: TokenPagination = Field(
|
|
117
|
+
..., description="Token-based pagination information"
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class VendorAssistantAlias(BaseModel):
|
|
122
|
+
"""Model representing a vendor assistant alias."""
|
|
123
|
+
|
|
124
|
+
model_config = ConfigDict(extra="ignore")
|
|
125
|
+
|
|
126
|
+
id: str = Field(..., description="Unique identifier for the alias")
|
|
127
|
+
name: str = Field(..., description="Name of the alias")
|
|
128
|
+
status: VendorAssistantStatus = Field(..., description="Status of the alias")
|
|
129
|
+
description: Optional[str] = Field(None, description="Description of the alias")
|
|
130
|
+
version: str = Field(..., description="Version of the alias")
|
|
131
|
+
createdAt: datetime = Field(
|
|
132
|
+
..., description="Creation timestamp", alias="createdAt"
|
|
133
|
+
)
|
|
134
|
+
updatedAt: datetime = Field(
|
|
135
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class VendorAssistantAliasesResponse(BaseModel):
|
|
140
|
+
"""Response model for vendor assistant aliases list."""
|
|
141
|
+
|
|
142
|
+
model_config = ConfigDict(extra="ignore")
|
|
143
|
+
|
|
144
|
+
data: List[VendorAssistantAlias] = Field(
|
|
145
|
+
..., description="List of vendor assistant aliases"
|
|
146
|
+
)
|
|
147
|
+
pagination: TokenPagination = Field(
|
|
148
|
+
..., description="Token-based pagination information"
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class VendorAssistantInstallRequest(BaseModel):
|
|
153
|
+
"""Model for a single assistant installation request."""
|
|
154
|
+
|
|
155
|
+
model_config = ConfigDict(extra="ignore")
|
|
156
|
+
|
|
157
|
+
id: str = Field(..., description="Assistant ID to install")
|
|
158
|
+
agentAliasId: str = Field(..., description="Alias ID to use for the assistant")
|
|
159
|
+
setting_id: str = Field(..., description="Vendor setting ID")
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
class VendorAssistantInstallSummary(BaseModel):
|
|
163
|
+
"""Model for assistant installation summary."""
|
|
164
|
+
|
|
165
|
+
model_config = ConfigDict(extra="ignore")
|
|
166
|
+
|
|
167
|
+
agentId: str = Field(..., description="Installed assistant ID")
|
|
168
|
+
agentAliasId: str = Field(..., description="Alias ID used for installation")
|
|
169
|
+
aiRunId: str = Field(..., description="AI run ID for the installation")
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class VendorAssistantInstallResponse(BaseModel):
|
|
173
|
+
"""Response model for assistant installation."""
|
|
174
|
+
|
|
175
|
+
model_config = ConfigDict(extra="ignore")
|
|
176
|
+
|
|
177
|
+
summary: List[VendorAssistantInstallSummary] = Field(
|
|
178
|
+
..., description="List of installation summaries"
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class VendorAssistantUninstallResponse(BaseModel):
|
|
183
|
+
"""Response model for assistant uninstallation."""
|
|
184
|
+
|
|
185
|
+
model_config = ConfigDict(extra="ignore")
|
|
186
|
+
|
|
187
|
+
success: bool = Field(..., description="Whether the uninstallation was successful")
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"""Models for vendor guardrail settings."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Optional, List
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
|
+
|
|
9
|
+
from .vendor_assistant import PaginationInfo, TokenPagination
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class VendorGuardrailSetting(BaseModel):
|
|
13
|
+
"""Model representing a vendor guardrail setting."""
|
|
14
|
+
|
|
15
|
+
model_config = ConfigDict(extra="ignore")
|
|
16
|
+
|
|
17
|
+
setting_id: str = Field(..., description="Unique identifier for the setting")
|
|
18
|
+
setting_name: str = Field(..., description="Name of the setting")
|
|
19
|
+
project: str = Field(..., description="Project associated with the setting")
|
|
20
|
+
entities: List[str] = Field(
|
|
21
|
+
default_factory=list, description="List of entities associated with the setting"
|
|
22
|
+
)
|
|
23
|
+
invalid: Optional[bool] = Field(None, description="Whether the setting is invalid")
|
|
24
|
+
error: Optional[str] = Field(
|
|
25
|
+
None, description="Error message if the setting is invalid"
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class VendorGuardrailSettingsResponse(BaseModel):
|
|
30
|
+
"""Response model for vendor guardrail settings list."""
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(extra="ignore")
|
|
33
|
+
|
|
34
|
+
data: List[VendorGuardrailSetting] = Field(
|
|
35
|
+
..., description="List of vendor guardrail settings"
|
|
36
|
+
)
|
|
37
|
+
pagination: PaginationInfo = Field(..., description="Pagination information")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class VendorGuardrailStatus(str, Enum):
|
|
41
|
+
"""Status of vendor guardrail."""
|
|
42
|
+
|
|
43
|
+
PREPARED = "PREPARED"
|
|
44
|
+
NOT_PREPARED = "NOT_PREPARED"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class VendorGuardrail(BaseModel):
|
|
48
|
+
"""Model representing a vendor guardrail."""
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(extra="ignore")
|
|
51
|
+
|
|
52
|
+
id: str = Field(..., description="Unique identifier for the guardrail")
|
|
53
|
+
name: str = Field(..., description="Name of the guardrail")
|
|
54
|
+
status: VendorGuardrailStatus = Field(..., description="Status of the guardrail")
|
|
55
|
+
description: Optional[str] = Field(None, description="Description of the guardrail")
|
|
56
|
+
version: str = Field(..., description="Version of the guardrail")
|
|
57
|
+
createdAt: datetime = Field(
|
|
58
|
+
..., description="Creation timestamp", alias="createdAt"
|
|
59
|
+
)
|
|
60
|
+
updatedAt: datetime = Field(
|
|
61
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class VendorGuardrailsResponse(BaseModel):
|
|
66
|
+
"""Response model for vendor guardrails list."""
|
|
67
|
+
|
|
68
|
+
model_config = ConfigDict(extra="ignore")
|
|
69
|
+
|
|
70
|
+
data: List[VendorGuardrail] = Field(..., description="List of vendor guardrails")
|
|
71
|
+
pagination: TokenPagination = Field(
|
|
72
|
+
..., description="Token-based pagination information"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class VendorGuardrailVersion(BaseModel):
|
|
77
|
+
"""Model representing a vendor guardrail version."""
|
|
78
|
+
|
|
79
|
+
model_config = ConfigDict(extra="ignore")
|
|
80
|
+
|
|
81
|
+
id: str = Field(..., description="Unique identifier for the guardrail")
|
|
82
|
+
version: str = Field(..., description="Version of the guardrail")
|
|
83
|
+
name: str = Field(..., description="Name of the guardrail")
|
|
84
|
+
status: VendorGuardrailStatus = Field(..., description="Status of the version")
|
|
85
|
+
description: Optional[str] = Field(None, description="Description of the version")
|
|
86
|
+
blockedInputMessaging: Optional[str] = Field(
|
|
87
|
+
None,
|
|
88
|
+
description="Message to display when input is blocked by guardrail",
|
|
89
|
+
alias="blockedInputMessaging",
|
|
90
|
+
)
|
|
91
|
+
blockedOutputsMessaging: Optional[str] = Field(
|
|
92
|
+
None,
|
|
93
|
+
description="Message to display when output is blocked by guardrail",
|
|
94
|
+
alias="blockedOutputsMessaging",
|
|
95
|
+
)
|
|
96
|
+
createdAt: datetime = Field(
|
|
97
|
+
..., description="Creation timestamp", alias="createdAt"
|
|
98
|
+
)
|
|
99
|
+
updatedAt: datetime = Field(
|
|
100
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class VendorGuardrailVersionsResponse(BaseModel):
|
|
105
|
+
"""Response model for vendor guardrail versions list."""
|
|
106
|
+
|
|
107
|
+
model_config = ConfigDict(extra="ignore")
|
|
108
|
+
|
|
109
|
+
data: List[VendorGuardrailVersion] = Field(
|
|
110
|
+
..., description="List of vendor guardrail versions"
|
|
111
|
+
)
|
|
112
|
+
pagination: TokenPagination = Field(
|
|
113
|
+
..., description="Token-based pagination information"
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class VendorGuardrailInstallRequest(BaseModel):
|
|
118
|
+
"""Model for a single guardrail installation request."""
|
|
119
|
+
|
|
120
|
+
model_config = ConfigDict(extra="ignore")
|
|
121
|
+
|
|
122
|
+
id: str = Field(..., description="Guardrail ID to install")
|
|
123
|
+
version: str = Field(..., description="Version to use for the guardrail")
|
|
124
|
+
setting_id: str = Field(..., description="Vendor setting ID")
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class VendorGuardrailInstallSummary(BaseModel):
|
|
128
|
+
"""Model for guardrail installation summary."""
|
|
129
|
+
|
|
130
|
+
model_config = ConfigDict(extra="ignore")
|
|
131
|
+
|
|
132
|
+
guardrailId: str = Field(..., description="Installed guardrail ID")
|
|
133
|
+
version: str = Field(..., description="Version used for installation")
|
|
134
|
+
aiRunId: str = Field(..., description="AI run ID for the installation")
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class VendorGuardrailInstallResponse(BaseModel):
|
|
138
|
+
"""Response model for guardrail installation."""
|
|
139
|
+
|
|
140
|
+
model_config = ConfigDict(extra="ignore")
|
|
141
|
+
|
|
142
|
+
summary: List[VendorGuardrailInstallSummary] = Field(
|
|
143
|
+
..., description="List of installation summaries"
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
class VendorGuardrailUninstallResponse(BaseModel):
|
|
148
|
+
"""Response model for guardrail uninstallation."""
|
|
149
|
+
|
|
150
|
+
model_config = ConfigDict(extra="ignore")
|
|
151
|
+
|
|
152
|
+
success: bool = Field(..., description="Whether the uninstallation was successful")
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"""Models for vendor knowledge base settings."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import Optional, List
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
8
|
+
|
|
9
|
+
from .vendor_assistant import PaginationInfo, TokenPagination
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class VendorKnowledgeBaseSetting(BaseModel):
|
|
13
|
+
"""Model representing a vendor knowledge base setting."""
|
|
14
|
+
|
|
15
|
+
model_config = ConfigDict(extra="ignore")
|
|
16
|
+
|
|
17
|
+
setting_id: str = Field(..., description="Unique identifier for the setting")
|
|
18
|
+
setting_name: str = Field(..., description="Name of the setting")
|
|
19
|
+
project: str = Field(..., description="Project associated with the setting")
|
|
20
|
+
entities: List[str] = Field(
|
|
21
|
+
default_factory=list, description="List of entities associated with the setting"
|
|
22
|
+
)
|
|
23
|
+
invalid: Optional[bool] = Field(None, description="Whether the setting is invalid")
|
|
24
|
+
error: Optional[str] = Field(
|
|
25
|
+
None, description="Error message if the setting is invalid"
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class VendorKnowledgeBaseSettingsResponse(BaseModel):
|
|
30
|
+
"""Response model for vendor knowledge base settings list."""
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(extra="ignore")
|
|
33
|
+
|
|
34
|
+
data: List[VendorKnowledgeBaseSetting] = Field(
|
|
35
|
+
..., description="List of vendor knowledge base settings"
|
|
36
|
+
)
|
|
37
|
+
pagination: PaginationInfo = Field(..., description="Pagination information")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class VendorKnowledgeBaseStatus(str, Enum):
|
|
41
|
+
"""Status of vendor knowledge base."""
|
|
42
|
+
|
|
43
|
+
PREPARED = "PREPARED"
|
|
44
|
+
NOT_PREPARED = "NOT_PREPARED"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class VendorKnowledgeBase(BaseModel):
|
|
48
|
+
"""Model representing a vendor knowledge base."""
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(extra="ignore")
|
|
51
|
+
|
|
52
|
+
id: str = Field(..., description="Unique identifier for the knowledge base")
|
|
53
|
+
name: str = Field(..., description="Name of the knowledge base")
|
|
54
|
+
status: VendorKnowledgeBaseStatus = Field(
|
|
55
|
+
..., description="Status of the knowledge base"
|
|
56
|
+
)
|
|
57
|
+
description: Optional[str] = Field(
|
|
58
|
+
None, description="Description of the knowledge base"
|
|
59
|
+
)
|
|
60
|
+
updatedAt: datetime = Field(
|
|
61
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
62
|
+
)
|
|
63
|
+
aiRunId: Optional[str] = Field(
|
|
64
|
+
None,
|
|
65
|
+
description="AI run ID if the knowledge base is installed",
|
|
66
|
+
alias="aiRunId",
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class VendorKnowledgeBasesResponse(BaseModel):
|
|
71
|
+
"""Response model for vendor knowledge bases list."""
|
|
72
|
+
|
|
73
|
+
model_config = ConfigDict(extra="ignore")
|
|
74
|
+
|
|
75
|
+
data: List[VendorKnowledgeBase] = Field(
|
|
76
|
+
..., description="List of vendor knowledge bases"
|
|
77
|
+
)
|
|
78
|
+
pagination: TokenPagination = Field(
|
|
79
|
+
..., description="Token-based pagination information"
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class VendorKnowledgeBaseDetail(BaseModel):
|
|
84
|
+
"""Model representing detailed information about a vendor knowledge base."""
|
|
85
|
+
|
|
86
|
+
model_config = ConfigDict(extra="ignore")
|
|
87
|
+
|
|
88
|
+
id: str = Field(..., description="Unique identifier for the knowledge base")
|
|
89
|
+
name: str = Field(..., description="Name of the knowledge base")
|
|
90
|
+
description: Optional[str] = Field(
|
|
91
|
+
None, description="Description of the knowledge base"
|
|
92
|
+
)
|
|
93
|
+
type: str = Field(..., description="Type of knowledge base (e.g., VECTOR)")
|
|
94
|
+
status: VendorKnowledgeBaseStatus = Field(
|
|
95
|
+
..., description="Status of the knowledge base"
|
|
96
|
+
)
|
|
97
|
+
embeddingModel: str = Field(
|
|
98
|
+
...,
|
|
99
|
+
description="Embedding model used by the knowledge base",
|
|
100
|
+
alias="embeddingModel",
|
|
101
|
+
)
|
|
102
|
+
kendraIndexArn: Optional[str] = Field(
|
|
103
|
+
None, description="Kendra index ARN if applicable", alias="kendraIndexArn"
|
|
104
|
+
)
|
|
105
|
+
createdAt: datetime = Field(
|
|
106
|
+
..., description="Creation timestamp", alias="createdAt"
|
|
107
|
+
)
|
|
108
|
+
updatedAt: datetime = Field(
|
|
109
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
110
|
+
)
|
|
111
|
+
aiRunId: Optional[str] = Field(
|
|
112
|
+
None,
|
|
113
|
+
description="AI run ID if the knowledge base is installed",
|
|
114
|
+
alias="aiRunId",
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class VendorKnowledgeBaseInstallRequest(BaseModel):
|
|
119
|
+
"""Model for a single knowledge base installation request."""
|
|
120
|
+
|
|
121
|
+
model_config = ConfigDict(extra="ignore")
|
|
122
|
+
|
|
123
|
+
id: str = Field(..., description="Knowledge base ID to install")
|
|
124
|
+
setting_id: str = Field(..., description="Vendor setting ID")
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class VendorKnowledgeBaseInstallSummary(BaseModel):
|
|
128
|
+
"""Model for knowledge base installation summary."""
|
|
129
|
+
|
|
130
|
+
model_config = ConfigDict(extra="ignore")
|
|
131
|
+
|
|
132
|
+
knowledgeBaseId: str = Field(..., description="Installed knowledge base ID")
|
|
133
|
+
aiRunId: str = Field(..., description="AI run ID for the installation")
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class VendorKnowledgeBaseInstallResponse(BaseModel):
|
|
137
|
+
"""Response model for knowledge base installation."""
|
|
138
|
+
|
|
139
|
+
model_config = ConfigDict(extra="ignore")
|
|
140
|
+
|
|
141
|
+
summary: List[VendorKnowledgeBaseInstallSummary] = Field(
|
|
142
|
+
..., description="List of installation summaries"
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class VendorKnowledgeBaseUninstallResponse(BaseModel):
|
|
147
|
+
"""Response model for knowledge base uninstallation."""
|
|
148
|
+
|
|
149
|
+
model_config = ConfigDict(extra="ignore")
|
|
150
|
+
|
|
151
|
+
success: bool = Field(..., description="Whether the uninstallation was successful")
|