codemie-sdk-python 0.1.222__py3-none-any.whl → 0.1.256__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.
- codemie_sdk/__init__.py +79 -3
- codemie_sdk/client/client.py +31 -3
- codemie_sdk/models/assistant.py +53 -0
- codemie_sdk/models/datasource.py +45 -0
- codemie_sdk/models/integration.py +1 -1
- 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_execution_payload.py +6 -2
- codemie_sdk/services/assistant.py +214 -0
- codemie_sdk/services/datasource.py +67 -0
- codemie_sdk/services/files.py +21 -0
- codemie_sdk/services/{vendor.py → vendor_assistant.py} +13 -13
- 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/workflow.py +10 -1
- codemie_sdk/services/workflow_execution.py +26 -4
- codemie_sdk/utils/http.py +21 -7
- {codemie_sdk_python-0.1.222.dist-info → codemie_sdk_python-0.1.256.dist-info}/METADATA +129 -9
- {codemie_sdk_python-0.1.222.dist-info → codemie_sdk_python-0.1.256.dist-info}/RECORD +22 -16
- {codemie_sdk_python-0.1.222.dist-info → codemie_sdk_python-0.1.256.dist-info}/WHEEL +0 -0
codemie_sdk/__init__.py
CHANGED
|
@@ -35,9 +35,50 @@ from .models.vendor_assistant import (
|
|
|
35
35
|
PaginationInfo,
|
|
36
36
|
TokenPagination,
|
|
37
37
|
)
|
|
38
|
-
from .
|
|
38
|
+
from .models.vendor_workflow import (
|
|
39
|
+
VendorWorkflowSetting,
|
|
40
|
+
VendorWorkflowSettingsResponse,
|
|
41
|
+
VendorWorkflow,
|
|
42
|
+
VendorWorkflowStatus,
|
|
43
|
+
VendorWorkflowsResponse,
|
|
44
|
+
VendorWorkflowAlias,
|
|
45
|
+
VendorWorkflowAliasesResponse,
|
|
46
|
+
VendorWorkflowInstallRequest,
|
|
47
|
+
VendorWorkflowInstallSummary,
|
|
48
|
+
VendorWorkflowInstallResponse,
|
|
49
|
+
VendorWorkflowUninstallResponse,
|
|
50
|
+
)
|
|
51
|
+
from .models.vendor_knowledgebase import (
|
|
52
|
+
VendorKnowledgeBaseSetting,
|
|
53
|
+
VendorKnowledgeBaseSettingsResponse,
|
|
54
|
+
VendorKnowledgeBase,
|
|
55
|
+
VendorKnowledgeBaseStatus,
|
|
56
|
+
VendorKnowledgeBasesResponse,
|
|
57
|
+
VendorKnowledgeBaseDetail,
|
|
58
|
+
VendorKnowledgeBaseInstallRequest,
|
|
59
|
+
VendorKnowledgeBaseInstallSummary,
|
|
60
|
+
VendorKnowledgeBaseInstallResponse,
|
|
61
|
+
VendorKnowledgeBaseUninstallResponse,
|
|
62
|
+
)
|
|
63
|
+
from .models.vendor_guardrail import (
|
|
64
|
+
VendorGuardrailSetting,
|
|
65
|
+
VendorGuardrailSettingsResponse,
|
|
66
|
+
VendorGuardrail,
|
|
67
|
+
VendorGuardrailStatus,
|
|
68
|
+
VendorGuardrailsResponse,
|
|
69
|
+
VendorGuardrailVersion,
|
|
70
|
+
VendorGuardrailVersionsResponse,
|
|
71
|
+
VendorGuardrailInstallRequest,
|
|
72
|
+
VendorGuardrailInstallSummary,
|
|
73
|
+
VendorGuardrailInstallResponse,
|
|
74
|
+
VendorGuardrailUninstallResponse,
|
|
75
|
+
)
|
|
76
|
+
from .services.vendor_assistant import VendorAssistantService
|
|
77
|
+
from .services.vendor_workflow import VendorWorkflowService
|
|
78
|
+
from .services.vendor_knowledgebase import VendorKnowledgeBaseService
|
|
79
|
+
from .services.vendor_guardrail import VendorGuardrailService
|
|
39
80
|
|
|
40
|
-
__version__ = "0.2.
|
|
81
|
+
__version__ = "0.2.12"
|
|
41
82
|
__all__ = [
|
|
42
83
|
"CodeMieClient",
|
|
43
84
|
"VendorType",
|
|
@@ -55,5 +96,40 @@ __all__ = [
|
|
|
55
96
|
"VendorAssistantUninstallResponse",
|
|
56
97
|
"PaginationInfo",
|
|
57
98
|
"TokenPagination",
|
|
58
|
-
"
|
|
99
|
+
"VendorAssistantService",
|
|
100
|
+
"VendorWorkflowSetting",
|
|
101
|
+
"VendorWorkflowSettingsResponse",
|
|
102
|
+
"VendorWorkflow",
|
|
103
|
+
"VendorWorkflowStatus",
|
|
104
|
+
"VendorWorkflowsResponse",
|
|
105
|
+
"VendorWorkflowAlias",
|
|
106
|
+
"VendorWorkflowAliasesResponse",
|
|
107
|
+
"VendorWorkflowInstallRequest",
|
|
108
|
+
"VendorWorkflowInstallSummary",
|
|
109
|
+
"VendorWorkflowInstallResponse",
|
|
110
|
+
"VendorWorkflowUninstallResponse",
|
|
111
|
+
"VendorWorkflowService",
|
|
112
|
+
"VendorKnowledgeBaseSetting",
|
|
113
|
+
"VendorKnowledgeBaseSettingsResponse",
|
|
114
|
+
"VendorKnowledgeBase",
|
|
115
|
+
"VendorKnowledgeBaseStatus",
|
|
116
|
+
"VendorKnowledgeBasesResponse",
|
|
117
|
+
"VendorKnowledgeBaseDetail",
|
|
118
|
+
"VendorKnowledgeBaseInstallRequest",
|
|
119
|
+
"VendorKnowledgeBaseInstallSummary",
|
|
120
|
+
"VendorKnowledgeBaseInstallResponse",
|
|
121
|
+
"VendorKnowledgeBaseUninstallResponse",
|
|
122
|
+
"VendorKnowledgeBaseService",
|
|
123
|
+
"VendorGuardrailSetting",
|
|
124
|
+
"VendorGuardrailSettingsResponse",
|
|
125
|
+
"VendorGuardrail",
|
|
126
|
+
"VendorGuardrailStatus",
|
|
127
|
+
"VendorGuardrailsResponse",
|
|
128
|
+
"VendorGuardrailVersion",
|
|
129
|
+
"VendorGuardrailVersionsResponse",
|
|
130
|
+
"VendorGuardrailInstallRequest",
|
|
131
|
+
"VendorGuardrailInstallSummary",
|
|
132
|
+
"VendorGuardrailInstallResponse",
|
|
133
|
+
"VendorGuardrailUninstallResponse",
|
|
134
|
+
"VendorGuardrailService",
|
|
59
135
|
]
|
codemie_sdk/client/client.py
CHANGED
|
@@ -13,7 +13,10 @@ from ..services.user import UserService
|
|
|
13
13
|
from ..services.workflow import WorkflowService
|
|
14
14
|
from ..services.files import FileOperationService
|
|
15
15
|
from ..services.webhook import WebhookService
|
|
16
|
-
from ..services.
|
|
16
|
+
from ..services.vendor_assistant import VendorAssistantService
|
|
17
|
+
from ..services.vendor_workflow import VendorWorkflowService
|
|
18
|
+
from ..services.vendor_knowledgebase import VendorKnowledgeBaseService
|
|
19
|
+
from ..services.vendor_guardrail import VendorGuardrailService
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
class CodeMieClient:
|
|
@@ -90,7 +93,16 @@ class CodeMieClient:
|
|
|
90
93
|
self.webhook = WebhookService(
|
|
91
94
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
92
95
|
)
|
|
93
|
-
self.
|
|
96
|
+
self.vendor_assistants = VendorAssistantService(
|
|
97
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
98
|
+
)
|
|
99
|
+
self.vendor_workflows = VendorWorkflowService(
|
|
100
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
101
|
+
)
|
|
102
|
+
self.vendor_knowledgebases = VendorKnowledgeBaseService(
|
|
103
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
104
|
+
)
|
|
105
|
+
self.vendor_guardrails = VendorGuardrailService(
|
|
94
106
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
95
107
|
)
|
|
96
108
|
|
|
@@ -108,6 +120,7 @@ class CodeMieClient:
|
|
|
108
120
|
"localhost",
|
|
109
121
|
"127.0.0.1",
|
|
110
122
|
"0.0.0.0",
|
|
123
|
+
"192.168",
|
|
111
124
|
]
|
|
112
125
|
return any(pattern in domain_lower for pattern in localhost_patterns)
|
|
113
126
|
|
|
@@ -139,7 +152,22 @@ class CodeMieClient:
|
|
|
139
152
|
self.conversations = ConversationService(
|
|
140
153
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
141
154
|
)
|
|
142
|
-
self.
|
|
155
|
+
self.files = FileOperationService(
|
|
156
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
157
|
+
)
|
|
158
|
+
self.webhook = WebhookService(
|
|
159
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
160
|
+
)
|
|
161
|
+
self.vendor_assistants = VendorAssistantService(
|
|
162
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
163
|
+
)
|
|
164
|
+
self.vendor_workflows = VendorWorkflowService(
|
|
165
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
166
|
+
)
|
|
167
|
+
self.vendor_knowledgebases = VendorKnowledgeBaseService(
|
|
168
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
169
|
+
)
|
|
170
|
+
self.vendor_guardrails = VendorGuardrailService(
|
|
143
171
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
144
172
|
)
|
|
145
173
|
return self._token
|
codemie_sdk/models/assistant.py
CHANGED
|
@@ -53,6 +53,16 @@ class Context(BaseModel):
|
|
|
53
53
|
name: str
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
class PromptVariable(BaseModel):
|
|
57
|
+
"""Model for assistant prompt variables."""
|
|
58
|
+
|
|
59
|
+
model_config = ConfigDict(extra="ignore")
|
|
60
|
+
|
|
61
|
+
key: str
|
|
62
|
+
description: Optional[str] = None
|
|
63
|
+
default_value: str
|
|
64
|
+
|
|
65
|
+
|
|
56
66
|
class MCPServerConfig(BaseModel):
|
|
57
67
|
"""
|
|
58
68
|
Configuration for an MCP server.
|
|
@@ -137,6 +147,17 @@ class AssistantBase(BaseModel):
|
|
|
137
147
|
icon_url: Optional[str] = None
|
|
138
148
|
|
|
139
149
|
|
|
150
|
+
class AssistantListResponse(BaseModel):
|
|
151
|
+
"""Model for assistant list response."""
|
|
152
|
+
|
|
153
|
+
model_config = ConfigDict(extra="ignore")
|
|
154
|
+
|
|
155
|
+
id: str
|
|
156
|
+
name: str
|
|
157
|
+
slug: Optional[str] = None
|
|
158
|
+
created_by: Optional[User] = None
|
|
159
|
+
|
|
160
|
+
|
|
140
161
|
class Assistant(AssistantBase):
|
|
141
162
|
"""Full assistant model with additional fields."""
|
|
142
163
|
|
|
@@ -164,6 +185,8 @@ class Assistant(AssistantBase):
|
|
|
164
185
|
user_abilities: Optional[List[Any]] = None
|
|
165
186
|
mcp_servers: List[MCPServerDetails] = Field(default_factory=list)
|
|
166
187
|
assistant_ids: List[str] = Field(default_factory=list)
|
|
188
|
+
version_count: Optional[int] = None
|
|
189
|
+
prompt_variables: Optional[List[PromptVariable]] = Field(default=None)
|
|
167
190
|
|
|
168
191
|
|
|
169
192
|
class AssistantRequestBase(AssistantBase):
|
|
@@ -191,6 +214,7 @@ class AssistantRequestBase(AssistantBase):
|
|
|
191
214
|
top_p: Optional[float] = None
|
|
192
215
|
mcp_servers: List[MCPServerDetails] = Field(default_factory=list)
|
|
193
216
|
assistant_ids: List[str] = Field(default_factory=list)
|
|
217
|
+
prompt_variables: List[PromptVariable] = Field(default_factory=list)
|
|
194
218
|
|
|
195
219
|
|
|
196
220
|
class AssistantCreateRequest(AssistantRequestBase):
|
|
@@ -205,6 +229,27 @@ class AssistantUpdateRequest(AssistantRequestBase):
|
|
|
205
229
|
pass
|
|
206
230
|
|
|
207
231
|
|
|
232
|
+
class AssistantVersion(BaseModel):
|
|
233
|
+
"""Immutable snapshot of assistant configuration for a specific version."""
|
|
234
|
+
|
|
235
|
+
model_config = ConfigDict(extra="ignore", use_enum_values=True)
|
|
236
|
+
|
|
237
|
+
version_number: int
|
|
238
|
+
created_date: datetime
|
|
239
|
+
created_by: Optional[User] = None
|
|
240
|
+
change_notes: Optional[str] = None
|
|
241
|
+
description: Optional[str] = None
|
|
242
|
+
system_prompt: str
|
|
243
|
+
llm_model_type: Optional[str] = None
|
|
244
|
+
temperature: Optional[float] = None
|
|
245
|
+
top_p: Optional[float] = None
|
|
246
|
+
context: List[Context] = Field(default_factory=list)
|
|
247
|
+
toolkits: List[ToolKitDetails] = Field(default_factory=list)
|
|
248
|
+
mcp_servers: List[MCPServerDetails] = Field(default_factory=list)
|
|
249
|
+
assistant_ids: List[str] = Field(default_factory=list)
|
|
250
|
+
prompt_variables: List[PromptVariable] = Field(default_factory=list)
|
|
251
|
+
|
|
252
|
+
|
|
208
253
|
class ChatRole(str, Enum):
|
|
209
254
|
"""Enum for chat message roles."""
|
|
210
255
|
|
|
@@ -263,6 +308,14 @@ class AssistantChatRequest(BaseModel):
|
|
|
263
308
|
default=None, description="DataSource in conversation history"
|
|
264
309
|
)
|
|
265
310
|
stream: bool = Field(default=False, description="Enable streaming response")
|
|
311
|
+
propagate_headers: bool = Field(
|
|
312
|
+
default=False,
|
|
313
|
+
description="Enable propagation of X-* HTTP headers to MCP servers during tool execution",
|
|
314
|
+
)
|
|
315
|
+
custom_metadata: Optional[dict[str, Any]] = Field(
|
|
316
|
+
default=None,
|
|
317
|
+
description="Custom metadata for the AI Assistant",
|
|
318
|
+
)
|
|
266
319
|
top_k: int = Field(default=10, description="Top K results to consider")
|
|
267
320
|
system_prompt: str = Field(default="", description="Override system prompt")
|
|
268
321
|
background_task: bool = Field(default=False, description="Run as background task")
|
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"""
|
|
@@ -259,6 +270,40 @@ class UpdateFileDataSourceRequest(BaseUpdateDataSourceRequest):
|
|
|
259
270
|
super().__init__(type=DataSourceType.FILE, **data)
|
|
260
271
|
|
|
261
272
|
|
|
273
|
+
class CodeAnalysisDataSourceRequest(BaseModel):
|
|
274
|
+
"""Model for provider-based datasource creation requests"""
|
|
275
|
+
|
|
276
|
+
model_config = ConfigDict(extra="ignore", populate_by_name=True)
|
|
277
|
+
|
|
278
|
+
name: str = Field(..., description="Datasource name")
|
|
279
|
+
description: Optional[str] = Field(None, description="Datasource description")
|
|
280
|
+
project_name: str = Field(..., description="Project name")
|
|
281
|
+
project_space_visible: bool = Field(False, alias="projectSpaceVisible")
|
|
282
|
+
branch: Optional[str] = Field(None, description="Git branch")
|
|
283
|
+
api_url: str = Field(..., description="Repository URL")
|
|
284
|
+
access_token: str = Field(..., description="Access token for repository")
|
|
285
|
+
analyzer: Optional[str] = Field(
|
|
286
|
+
None, description="Code analyzer type (e.g., Java, Python)"
|
|
287
|
+
)
|
|
288
|
+
datasource_root: str = Field("/", description="Root directory to analyze")
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
class CodeExplorationDataSourceRequest(BaseModel):
|
|
292
|
+
"""Model for CodeExplorationToolkit datasource creation requests"""
|
|
293
|
+
|
|
294
|
+
model_config = ConfigDict(extra="ignore", populate_by_name=True)
|
|
295
|
+
|
|
296
|
+
name: str = Field(..., description="Datasource name")
|
|
297
|
+
description: Optional[str] = Field(None, description="Datasource description")
|
|
298
|
+
project_name: str = Field(..., description="Project name")
|
|
299
|
+
project_space_visible: bool = Field(False, alias="projectSpaceVisible")
|
|
300
|
+
code_analysis_datasource_ids: List[str] = Field(
|
|
301
|
+
...,
|
|
302
|
+
alias="code_analysis_datasource_ids",
|
|
303
|
+
description="List of CodeAnalysisToolkit datasource IDs",
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
|
|
262
307
|
class DataSource(BaseModel):
|
|
263
308
|
model_config = ConfigDict(
|
|
264
309
|
extra="ignore",
|
|
@@ -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")
|