codemie-sdk-python 0.1.204__py3-none-any.whl → 0.1.230__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 CHANGED
@@ -18,6 +18,118 @@ Basic usage:
18
18
  """
19
19
 
20
20
  from .client.client import CodeMieClient
21
+ from .models.vendor_assistant import (
22
+ VendorType,
23
+ VendorAssistantSetting,
24
+ VendorAssistantSettingsResponse,
25
+ VendorAssistant,
26
+ VendorAssistantVersion,
27
+ VendorAssistantStatus,
28
+ VendorAssistantsResponse,
29
+ VendorAssistantAlias,
30
+ VendorAssistantAliasesResponse,
31
+ VendorAssistantInstallRequest,
32
+ VendorAssistantInstallSummary,
33
+ VendorAssistantInstallResponse,
34
+ VendorAssistantUninstallResponse,
35
+ PaginationInfo,
36
+ TokenPagination,
37
+ )
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
21
80
 
22
- __version__ = "0.2.7"
23
- __all__ = ["CodeMieClient"]
81
+ __version__ = "0.2.12"
82
+ __all__ = [
83
+ "CodeMieClient",
84
+ "VendorType",
85
+ "VendorAssistantSetting",
86
+ "VendorAssistantSettingsResponse",
87
+ "VendorAssistant",
88
+ "VendorAssistantVersion",
89
+ "VendorAssistantStatus",
90
+ "VendorAssistantsResponse",
91
+ "VendorAssistantAlias",
92
+ "VendorAssistantAliasesResponse",
93
+ "VendorAssistantInstallRequest",
94
+ "VendorAssistantInstallSummary",
95
+ "VendorAssistantInstallResponse",
96
+ "VendorAssistantUninstallResponse",
97
+ "PaginationInfo",
98
+ "TokenPagination",
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",
135
+ ]
@@ -12,6 +12,11 @@ from ..services.task import TaskService
12
12
  from ..services.user import UserService
13
13
  from ..services.workflow import WorkflowService
14
14
  from ..services.files import FileOperationService
15
+ from ..services.webhook import WebhookService
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
15
20
 
16
21
 
17
22
  class CodeMieClient:
@@ -85,6 +90,21 @@ class CodeMieClient:
85
90
  self.files = FileOperationService(
86
91
  self._api_domain, self._token, verify_ssl=self._verify_ssl
87
92
  )
93
+ self.webhook = WebhookService(
94
+ self._api_domain, self._token, verify_ssl=self._verify_ssl
95
+ )
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(
106
+ self._api_domain, self._token, verify_ssl=self._verify_ssl
107
+ )
88
108
 
89
109
  @property
90
110
  def token(self) -> str:
@@ -131,4 +151,16 @@ class CodeMieClient:
131
151
  self.conversations = ConversationService(
132
152
  self._api_domain, self._token, verify_ssl=self._verify_ssl
133
153
  )
154
+ self.vendor_assistants = VendorAssistantService(
155
+ self._api_domain, self._token, verify_ssl=self._verify_ssl
156
+ )
157
+ self.vendor_workflows = VendorWorkflowService(
158
+ self._api_domain, self._token, verify_ssl=self._verify_ssl
159
+ )
160
+ self.vendor_knowledgebases = VendorKnowledgeBaseService(
161
+ self._api_domain, self._token, verify_ssl=self._verify_ssl
162
+ )
163
+ self.vendor_guardrails = VendorGuardrailService(
164
+ self._api_domain, self._token, verify_ssl=self._verify_ssl
165
+ )
134
166
  return self._token
@@ -164,6 +164,7 @@ class Assistant(AssistantBase):
164
164
  user_abilities: Optional[List[Any]] = None
165
165
  mcp_servers: List[MCPServerDetails] = Field(default_factory=list)
166
166
  assistant_ids: List[str] = Field(default_factory=list)
167
+ version_count: Optional[int] = None
167
168
 
168
169
 
169
170
  class AssistantRequestBase(AssistantBase):
@@ -205,6 +206,26 @@ class AssistantUpdateRequest(AssistantRequestBase):
205
206
  pass
206
207
 
207
208
 
209
+ class AssistantVersion(BaseModel):
210
+ """Immutable snapshot of assistant configuration for a specific version."""
211
+
212
+ model_config = ConfigDict(extra="ignore", use_enum_values=True)
213
+
214
+ version_number: int
215
+ created_date: datetime
216
+ created_by: Optional[User] = None
217
+ change_notes: Optional[str] = None
218
+ description: Optional[str] = None
219
+ system_prompt: str
220
+ llm_model_type: Optional[str] = None
221
+ temperature: Optional[float] = None
222
+ top_p: Optional[float] = None
223
+ context: List[Context] = Field(default_factory=list)
224
+ toolkits: List[ToolKitDetails] = Field(default_factory=list)
225
+ mcp_servers: List[MCPServerDetails] = Field(default_factory=list)
226
+ assistant_ids: List[str] = Field(default_factory=list)
227
+
228
+
208
229
  class ChatRole(str, Enum):
209
230
  """Enum for chat message roles."""
210
231
 
@@ -263,6 +284,14 @@ class AssistantChatRequest(BaseModel):
263
284
  default=None, description="DataSource in conversation history"
264
285
  )
265
286
  stream: bool = Field(default=False, description="Enable streaming response")
287
+ propagate_headers: bool = Field(
288
+ default=False,
289
+ description="Enable propagation of X-* HTTP headers to MCP servers during tool execution",
290
+ )
291
+ custom_metadata: Optional[dict[str, Any]] = Field(
292
+ default=None,
293
+ description="Custom metadata for the AI Assistant",
294
+ )
266
295
  top_k: int = Field(default=10, description="Top K results to consider")
267
296
  system_prompt: str = Field(default="", description="Override system prompt")
268
297
  background_task: bool = Field(default=False, description="Run as background task")
@@ -25,6 +25,7 @@ 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"
28
29
 
29
30
 
30
31
  class DataSourceStatus(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")