codemie-sdk-python 0.1.221__tar.gz → 0.1.223__tar.gz
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_python-0.1.221 → codemie_sdk_python-0.1.223}/PKG-INFO +1 -1
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/pyproject.toml +1 -1
- codemie_sdk_python-0.1.223/src/codemie_sdk/__init__.py +85 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/client/client.py +14 -0
- codemie_sdk_python-0.1.223/src/codemie_sdk/models/vendor_assistant.py +187 -0
- codemie_sdk_python-0.1.223/src/codemie_sdk/models/vendor_workflow.py +145 -0
- codemie_sdk_python-0.1.223/src/codemie_sdk/services/vendor_assistant.py +364 -0
- codemie_sdk_python-0.1.223/src/codemie_sdk/services/vendor_workflow.py +330 -0
- codemie_sdk_python-0.1.221/src/codemie_sdk/__init__.py +0 -23
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/README.md +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/auth/__init__.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/auth/credentials.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/client/__init__.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/exceptions.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/__init__.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/assistant.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/common.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/conversation.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/datasource.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/file_operation.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/integration.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/llm.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/task.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/user.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow_execution_payload.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow_state.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow_thoughts.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/assistant.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/conversation.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/datasource.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/files.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/integration.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/llm.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/task.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/user.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/webhook.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/workflow.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/workflow_execution.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/workflow_execution_state.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/utils/__init__.py +0 -0
- {codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/utils/http.py +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CodeMie SDK for Python
|
|
3
|
+
~~~~~~~~~~~~~~~~~~~~~
|
|
4
|
+
|
|
5
|
+
A Python SDK for interacting with CodeMie API.
|
|
6
|
+
|
|
7
|
+
Basic usage:
|
|
8
|
+
|
|
9
|
+
>>> from codemie_sdk import CodeMieClient
|
|
10
|
+
>>> client = CodeMieClient(
|
|
11
|
+
... auth_server_url="https://auth.example.com",
|
|
12
|
+
... auth_client_id="client_id",
|
|
13
|
+
... auth_client_secret="secret",
|
|
14
|
+
... auth_realm_name="realm",
|
|
15
|
+
... codemie_api_domain="api.codemie.com"
|
|
16
|
+
... )
|
|
17
|
+
>>> assistants = client.assistants.list()
|
|
18
|
+
"""
|
|
19
|
+
|
|
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 .services.vendor_assistant import VendorAssistantService
|
|
52
|
+
from .services.vendor_workflow import VendorWorkflowService
|
|
53
|
+
|
|
54
|
+
__version__ = "0.2.10"
|
|
55
|
+
__all__ = [
|
|
56
|
+
"CodeMieClient",
|
|
57
|
+
"VendorType",
|
|
58
|
+
"VendorAssistantSetting",
|
|
59
|
+
"VendorAssistantSettingsResponse",
|
|
60
|
+
"VendorAssistant",
|
|
61
|
+
"VendorAssistantVersion",
|
|
62
|
+
"VendorAssistantStatus",
|
|
63
|
+
"VendorAssistantsResponse",
|
|
64
|
+
"VendorAssistantAlias",
|
|
65
|
+
"VendorAssistantAliasesResponse",
|
|
66
|
+
"VendorAssistantInstallRequest",
|
|
67
|
+
"VendorAssistantInstallSummary",
|
|
68
|
+
"VendorAssistantInstallResponse",
|
|
69
|
+
"VendorAssistantUninstallResponse",
|
|
70
|
+
"PaginationInfo",
|
|
71
|
+
"TokenPagination",
|
|
72
|
+
"VendorAssistantService",
|
|
73
|
+
"VendorWorkflowSetting",
|
|
74
|
+
"VendorWorkflowSettingsResponse",
|
|
75
|
+
"VendorWorkflow",
|
|
76
|
+
"VendorWorkflowStatus",
|
|
77
|
+
"VendorWorkflowsResponse",
|
|
78
|
+
"VendorWorkflowAlias",
|
|
79
|
+
"VendorWorkflowAliasesResponse",
|
|
80
|
+
"VendorWorkflowInstallRequest",
|
|
81
|
+
"VendorWorkflowInstallSummary",
|
|
82
|
+
"VendorWorkflowInstallResponse",
|
|
83
|
+
"VendorWorkflowUninstallResponse",
|
|
84
|
+
"VendorWorkflowService",
|
|
85
|
+
]
|
|
@@ -13,6 +13,8 @@ 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.vendor_assistant import VendorAssistantService
|
|
17
|
+
from ..services.vendor_workflow import VendorWorkflowService
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
class CodeMieClient:
|
|
@@ -89,6 +91,12 @@ class CodeMieClient:
|
|
|
89
91
|
self.webhook = WebhookService(
|
|
90
92
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
91
93
|
)
|
|
94
|
+
self.vendor_assistants = VendorAssistantService(
|
|
95
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
96
|
+
)
|
|
97
|
+
self.vendor_workflows = VendorWorkflowService(
|
|
98
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
99
|
+
)
|
|
92
100
|
|
|
93
101
|
@property
|
|
94
102
|
def token(self) -> str:
|
|
@@ -135,4 +143,10 @@ class CodeMieClient:
|
|
|
135
143
|
self.conversations = ConversationService(
|
|
136
144
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
137
145
|
)
|
|
146
|
+
self.vendor_assistants = VendorAssistantService(
|
|
147
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
148
|
+
)
|
|
149
|
+
self.vendor_workflows = VendorWorkflowService(
|
|
150
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
151
|
+
)
|
|
138
152
|
return self._token
|
|
@@ -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,145 @@
|
|
|
1
|
+
"""Models for vendor workflow 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 VendorWorkflowSetting(BaseModel):
|
|
13
|
+
"""Model representing a vendor workflow 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 VendorWorkflowSettingsResponse(BaseModel):
|
|
30
|
+
"""Response model for vendor workflow settings list."""
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(extra="ignore")
|
|
33
|
+
|
|
34
|
+
data: List[VendorWorkflowSetting] = Field(
|
|
35
|
+
..., description="List of vendor workflow settings"
|
|
36
|
+
)
|
|
37
|
+
pagination: PaginationInfo = Field(..., description="Pagination information")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class VendorWorkflowStatus(str, Enum):
|
|
41
|
+
"""Status of vendor workflow."""
|
|
42
|
+
|
|
43
|
+
PREPARED = "PREPARED"
|
|
44
|
+
NOT_PREPARED = "NOT_PREPARED"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class VendorWorkflow(BaseModel):
|
|
48
|
+
"""Model representing a vendor workflow."""
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(extra="ignore")
|
|
51
|
+
|
|
52
|
+
id: str = Field(..., description="Unique identifier for the workflow")
|
|
53
|
+
name: str = Field(..., description="Name of the workflow")
|
|
54
|
+
status: VendorWorkflowStatus = Field(..., description="Status of the workflow")
|
|
55
|
+
description: Optional[str] = Field(None, description="Description of the workflow")
|
|
56
|
+
version: str = Field(..., description="Version of the workflow")
|
|
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 VendorWorkflowsResponse(BaseModel):
|
|
66
|
+
"""Response model for vendor workflows list."""
|
|
67
|
+
|
|
68
|
+
model_config = ConfigDict(extra="ignore")
|
|
69
|
+
|
|
70
|
+
data: List[VendorWorkflow] = Field(..., description="List of vendor workflows")
|
|
71
|
+
pagination: TokenPagination = Field(
|
|
72
|
+
..., description="Token-based pagination information"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class VendorWorkflowAlias(BaseModel):
|
|
77
|
+
"""Model representing a vendor workflow alias."""
|
|
78
|
+
|
|
79
|
+
model_config = ConfigDict(extra="ignore")
|
|
80
|
+
|
|
81
|
+
id: str = Field(..., description="Unique identifier for the alias")
|
|
82
|
+
name: str = Field(..., description="Name of the alias")
|
|
83
|
+
status: VendorWorkflowStatus = Field(..., description="Status of the alias")
|
|
84
|
+
description: Optional[str] = Field(None, description="Description of the alias")
|
|
85
|
+
version: str = Field(..., description="Version of the alias")
|
|
86
|
+
createdAt: datetime = Field(
|
|
87
|
+
..., description="Creation timestamp", alias="createdAt"
|
|
88
|
+
)
|
|
89
|
+
updatedAt: datetime = Field(
|
|
90
|
+
..., description="Last update timestamp", alias="updatedAt"
|
|
91
|
+
)
|
|
92
|
+
aiRunId: Optional[str] = Field(
|
|
93
|
+
None, description="AI run ID if the alias is installed", alias="aiRunId"
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class VendorWorkflowAliasesResponse(BaseModel):
|
|
98
|
+
"""Response model for vendor workflow aliases list."""
|
|
99
|
+
|
|
100
|
+
model_config = ConfigDict(extra="ignore")
|
|
101
|
+
|
|
102
|
+
data: List[VendorWorkflowAlias] = Field(
|
|
103
|
+
..., description="List of vendor workflow aliases"
|
|
104
|
+
)
|
|
105
|
+
pagination: TokenPagination = Field(
|
|
106
|
+
..., description="Token-based pagination information"
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class VendorWorkflowInstallRequest(BaseModel):
|
|
111
|
+
"""Model for a single workflow installation request."""
|
|
112
|
+
|
|
113
|
+
model_config = ConfigDict(extra="ignore")
|
|
114
|
+
|
|
115
|
+
id: str = Field(..., description="Workflow ID to install")
|
|
116
|
+
flowAliasId: str = Field(..., description="Flow alias ID to use for the workflow")
|
|
117
|
+
setting_id: str = Field(..., description="Vendor setting ID")
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class VendorWorkflowInstallSummary(BaseModel):
|
|
121
|
+
"""Model for workflow installation summary."""
|
|
122
|
+
|
|
123
|
+
model_config = ConfigDict(extra="ignore")
|
|
124
|
+
|
|
125
|
+
flowId: str = Field(..., description="Installed workflow ID")
|
|
126
|
+
flowAliasId: str = Field(..., description="Flow alias ID used for installation")
|
|
127
|
+
aiRunId: str = Field(..., description="AI run ID for the installation")
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class VendorWorkflowInstallResponse(BaseModel):
|
|
131
|
+
"""Response model for workflow installation."""
|
|
132
|
+
|
|
133
|
+
model_config = ConfigDict(extra="ignore")
|
|
134
|
+
|
|
135
|
+
summary: List[VendorWorkflowInstallSummary] = Field(
|
|
136
|
+
..., description="List of installation summaries"
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
class VendorWorkflowUninstallResponse(BaseModel):
|
|
141
|
+
"""Response model for workflow uninstallation."""
|
|
142
|
+
|
|
143
|
+
model_config = ConfigDict(extra="ignore")
|
|
144
|
+
|
|
145
|
+
success: bool = Field(..., description="Whether the uninstallation was successful")
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
"""Vendor service implementation for managing cloud vendor assistant settings."""
|
|
2
|
+
|
|
3
|
+
from typing import Union, Optional, List
|
|
4
|
+
|
|
5
|
+
from ..models.vendor_assistant import (
|
|
6
|
+
VendorType,
|
|
7
|
+
VendorAssistantSettingsResponse,
|
|
8
|
+
VendorAssistantsResponse,
|
|
9
|
+
VendorAssistant,
|
|
10
|
+
VendorAssistantVersion,
|
|
11
|
+
VendorAssistantAliasesResponse,
|
|
12
|
+
VendorAssistantInstallRequest,
|
|
13
|
+
VendorAssistantInstallResponse,
|
|
14
|
+
VendorAssistantUninstallResponse,
|
|
15
|
+
)
|
|
16
|
+
from ..utils import ApiRequestHandler
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class VendorAssistantService:
|
|
20
|
+
"""Service for managing cloud vendor assistant settings (AWS, Azure, GCP)."""
|
|
21
|
+
|
|
22
|
+
def __init__(self, api_domain: str, token: str, verify_ssl: bool = True):
|
|
23
|
+
"""Initialize the vendor service.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
api_domain: Base URL for the CodeMie API
|
|
27
|
+
token: Authentication token
|
|
28
|
+
verify_ssl: Whether to verify SSL certificates
|
|
29
|
+
"""
|
|
30
|
+
self._api = ApiRequestHandler(api_domain, token, verify_ssl)
|
|
31
|
+
|
|
32
|
+
def get_assistant_settings(
|
|
33
|
+
self,
|
|
34
|
+
vendor: Union[VendorType, str],
|
|
35
|
+
page: int = 0,
|
|
36
|
+
per_page: int = 10,
|
|
37
|
+
) -> VendorAssistantSettingsResponse:
|
|
38
|
+
"""Get assistant settings for a specific cloud vendor.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
42
|
+
page: Page number for pagination (0-based)
|
|
43
|
+
per_page: Number of items per page
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
VendorAssistantSettingsResponse containing list of settings and pagination info
|
|
47
|
+
|
|
48
|
+
Example:
|
|
49
|
+
>>> # Using enum
|
|
50
|
+
>>> settings = client.vendor_assistants.get_assistant_settings(VendorType.AWS, page=0, per_page=10)
|
|
51
|
+
>>> # Using string
|
|
52
|
+
>>> settings = client.vendor_assistants.get_assistant_settings("aws", page=0, per_page=10)
|
|
53
|
+
"""
|
|
54
|
+
# Convert enum to string value if needed
|
|
55
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
56
|
+
|
|
57
|
+
params = {
|
|
58
|
+
"page": page,
|
|
59
|
+
"per_page": per_page,
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return self._api.get(
|
|
63
|
+
f"/v1/vendors/{vendor_str}/assistants/settings",
|
|
64
|
+
VendorAssistantSettingsResponse,
|
|
65
|
+
params=params,
|
|
66
|
+
wrap_response=False,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
def get_assistants(
|
|
70
|
+
self,
|
|
71
|
+
vendor: Union[VendorType, str],
|
|
72
|
+
setting_id: str,
|
|
73
|
+
per_page: int = 10,
|
|
74
|
+
next_token: Optional[str] = None,
|
|
75
|
+
) -> VendorAssistantsResponse:
|
|
76
|
+
"""Get assistants for a specific vendor setting.
|
|
77
|
+
|
|
78
|
+
Args:
|
|
79
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
80
|
+
setting_id: ID of the vendor setting to retrieve assistants for
|
|
81
|
+
per_page: Number of items per page
|
|
82
|
+
next_token: Token for pagination (optional, for retrieving next page)
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
VendorAssistantsResponse containing list of assistants and pagination token
|
|
86
|
+
|
|
87
|
+
Example:
|
|
88
|
+
>>> # Get first page
|
|
89
|
+
>>> assistants = client.vendor_assistants.get_assistants(
|
|
90
|
+
... vendor=VendorType.AWS,
|
|
91
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
92
|
+
... per_page=8
|
|
93
|
+
... )
|
|
94
|
+
>>> # Get next page if available
|
|
95
|
+
>>> if assistants.pagination.next_token:
|
|
96
|
+
... next_page = client.vendor_assistants.get_assistants(
|
|
97
|
+
... vendor=VendorType.AWS,
|
|
98
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
99
|
+
... per_page=8,
|
|
100
|
+
... next_token=assistants.pagination.next_token
|
|
101
|
+
... )
|
|
102
|
+
"""
|
|
103
|
+
# Convert enum to string value if needed
|
|
104
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
105
|
+
|
|
106
|
+
params = {
|
|
107
|
+
"setting_id": setting_id,
|
|
108
|
+
"per_page": per_page,
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if next_token:
|
|
112
|
+
params["next_token"] = next_token
|
|
113
|
+
|
|
114
|
+
return self._api.get(
|
|
115
|
+
f"/v1/vendors/{vendor_str}/assistants",
|
|
116
|
+
VendorAssistantsResponse,
|
|
117
|
+
params=params,
|
|
118
|
+
wrap_response=False,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
def get_assistant(
|
|
122
|
+
self,
|
|
123
|
+
vendor: Union[VendorType, str],
|
|
124
|
+
assistant_id: str,
|
|
125
|
+
setting_id: str,
|
|
126
|
+
) -> VendorAssistant:
|
|
127
|
+
"""Get a specific assistant by ID for a vendor setting.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
131
|
+
assistant_id: ID of the assistant to retrieve
|
|
132
|
+
setting_id: ID of the vendor setting
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
VendorAssistant containing assistant details
|
|
136
|
+
|
|
137
|
+
Example:
|
|
138
|
+
>>> assistant = client.vendor_assistants.get_assistant(
|
|
139
|
+
... vendor=VendorType.AWS,
|
|
140
|
+
... assistant_id="TJBKR0DGWT",
|
|
141
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
142
|
+
... )
|
|
143
|
+
>>> print(f"Name: {assistant.name}, Status: {assistant.status}")
|
|
144
|
+
"""
|
|
145
|
+
# Convert enum to string value if needed
|
|
146
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
147
|
+
|
|
148
|
+
params = {
|
|
149
|
+
"setting_id": setting_id,
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return self._api.get(
|
|
153
|
+
f"/v1/vendors/{vendor_str}/assistants/{assistant_id}",
|
|
154
|
+
VendorAssistant,
|
|
155
|
+
params=params,
|
|
156
|
+
wrap_response=False,
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
def get_assistant_version(
|
|
160
|
+
self,
|
|
161
|
+
vendor: Union[VendorType, str],
|
|
162
|
+
assistant_id: str,
|
|
163
|
+
version: str,
|
|
164
|
+
setting_id: str,
|
|
165
|
+
) -> VendorAssistantVersion:
|
|
166
|
+
"""Get a specific version of a vendor assistant with detailed information.
|
|
167
|
+
|
|
168
|
+
Args:
|
|
169
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
170
|
+
assistant_id: ID of the assistant to retrieve
|
|
171
|
+
version: Version number to retrieve (e.g., "1", "DRAFT")
|
|
172
|
+
setting_id: ID of the vendor setting
|
|
173
|
+
|
|
174
|
+
Returns:
|
|
175
|
+
VendorAssistantVersion containing detailed version information including
|
|
176
|
+
instruction, foundation model, and timestamps
|
|
177
|
+
|
|
178
|
+
Example:
|
|
179
|
+
>>> version_details = client.vendor_assistants.get_assistant_version(
|
|
180
|
+
... vendor=VendorType.AWS,
|
|
181
|
+
... assistant_id="TJBKR0DGWT",
|
|
182
|
+
... version="1",
|
|
183
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
184
|
+
... )
|
|
185
|
+
>>> print(f"Name: {version_details.name}")
|
|
186
|
+
>>> print(f"Version: {version_details.version}")
|
|
187
|
+
>>> print(f"Instruction: {version_details.instruction}")
|
|
188
|
+
>>> print(f"Model: {version_details.foundationModel}")
|
|
189
|
+
"""
|
|
190
|
+
# Convert enum to string value if needed
|
|
191
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
192
|
+
|
|
193
|
+
params = {
|
|
194
|
+
"setting_id": setting_id,
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return self._api.get(
|
|
198
|
+
f"/v1/vendors/{vendor_str}/assistants/{assistant_id}/{version}",
|
|
199
|
+
VendorAssistantVersion,
|
|
200
|
+
params=params,
|
|
201
|
+
wrap_response=False,
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
def get_assistant_aliases(
|
|
205
|
+
self,
|
|
206
|
+
vendor: Union[VendorType, str],
|
|
207
|
+
assistant_id: str,
|
|
208
|
+
setting_id: str,
|
|
209
|
+
per_page: int = 10,
|
|
210
|
+
next_token: Optional[str] = None,
|
|
211
|
+
) -> VendorAssistantAliasesResponse:
|
|
212
|
+
"""Get aliases for a specific vendor assistant.
|
|
213
|
+
|
|
214
|
+
Args:
|
|
215
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
216
|
+
assistant_id: ID of the assistant to retrieve aliases for
|
|
217
|
+
setting_id: ID of the vendor setting
|
|
218
|
+
per_page: Number of items per page
|
|
219
|
+
next_token: Token for pagination (optional, for retrieving next page)
|
|
220
|
+
|
|
221
|
+
Returns:
|
|
222
|
+
VendorAssistantAliasesResponse containing list of aliases and pagination token
|
|
223
|
+
|
|
224
|
+
Example:
|
|
225
|
+
>>> # Get first page of aliases
|
|
226
|
+
>>> aliases = client.vendor_assistants.get_assistant_aliases(
|
|
227
|
+
... vendor=VendorType.AWS,
|
|
228
|
+
... assistant_id="TJBKR0DGWT",
|
|
229
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
230
|
+
... per_page=5
|
|
231
|
+
... )
|
|
232
|
+
>>> for alias in aliases.data:
|
|
233
|
+
... print(f"{alias.name} (v{alias.version}): {alias.status}")
|
|
234
|
+
>>> # Get next page if available
|
|
235
|
+
>>> if aliases.pagination.next_token:
|
|
236
|
+
... next_page = client.vendor_assistants.get_assistant_aliases(
|
|
237
|
+
... vendor=VendorType.AWS,
|
|
238
|
+
... assistant_id="TJBKR0DGWT",
|
|
239
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
240
|
+
... per_page=5,
|
|
241
|
+
... next_token=aliases.pagination.next_token
|
|
242
|
+
... )
|
|
243
|
+
"""
|
|
244
|
+
# Convert enum to string value if needed
|
|
245
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
246
|
+
|
|
247
|
+
params = {
|
|
248
|
+
"setting_id": setting_id,
|
|
249
|
+
"per_page": per_page,
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if next_token:
|
|
253
|
+
params["next_token"] = next_token
|
|
254
|
+
|
|
255
|
+
return self._api.get(
|
|
256
|
+
f"/v1/vendors/{vendor_str}/assistants/{assistant_id}/aliases",
|
|
257
|
+
VendorAssistantAliasesResponse,
|
|
258
|
+
params=params,
|
|
259
|
+
wrap_response=False,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
def install_assistants(
|
|
263
|
+
self,
|
|
264
|
+
vendor: Union[VendorType, str],
|
|
265
|
+
assistants: List[VendorAssistantInstallRequest],
|
|
266
|
+
) -> VendorAssistantInstallResponse:
|
|
267
|
+
"""Install/activate vendor assistants.
|
|
268
|
+
|
|
269
|
+
Args:
|
|
270
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
271
|
+
assistants: List of assistant installation requests with assistant ID, alias ID, and setting ID
|
|
272
|
+
|
|
273
|
+
Returns:
|
|
274
|
+
VendorAssistantInstallResponse containing installation summary with AI run IDs
|
|
275
|
+
|
|
276
|
+
Example:
|
|
277
|
+
>>> from codemie_sdk import VendorAssistantInstallRequest
|
|
278
|
+
>>> # Install single assistant
|
|
279
|
+
>>> install_request = VendorAssistantInstallRequest(
|
|
280
|
+
... id="TJBKR0DGWT",
|
|
281
|
+
... agentAliasId="MNULODIW4N",
|
|
282
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
283
|
+
... )
|
|
284
|
+
>>> response = client.vendor_assistants.install_assistants(
|
|
285
|
+
... vendor=VendorType.AWS,
|
|
286
|
+
... assistants=[install_request]
|
|
287
|
+
... )
|
|
288
|
+
>>> for item in response.summary:
|
|
289
|
+
... print(f"Installed {item.agentId} with run ID: {item.aiRunId}")
|
|
290
|
+
>>>
|
|
291
|
+
>>> # Install multiple assistants
|
|
292
|
+
>>> requests = [
|
|
293
|
+
... VendorAssistantInstallRequest(
|
|
294
|
+
... id="ASSISTANT_ID_1",
|
|
295
|
+
... agentAliasId="ALIAS_ID_1",
|
|
296
|
+
... setting_id="SETTING_ID"
|
|
297
|
+
... ),
|
|
298
|
+
... VendorAssistantInstallRequest(
|
|
299
|
+
... id="ASSISTANT_ID_2",
|
|
300
|
+
... agentAliasId="ALIAS_ID_2",
|
|
301
|
+
... setting_id="SETTING_ID"
|
|
302
|
+
... )
|
|
303
|
+
... ]
|
|
304
|
+
>>> response = client.vendor_assistants.install_assistants(
|
|
305
|
+
... vendor=VendorType.AWS,
|
|
306
|
+
... assistants=requests
|
|
307
|
+
... )
|
|
308
|
+
"""
|
|
309
|
+
# Convert enum to string value if needed
|
|
310
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
311
|
+
|
|
312
|
+
# Convert list of Pydantic models to list of dicts
|
|
313
|
+
payload = [assistant.model_dump(by_alias=True) for assistant in assistants]
|
|
314
|
+
|
|
315
|
+
return self._api.post(
|
|
316
|
+
f"/v1/vendors/{vendor_str}/assistants",
|
|
317
|
+
VendorAssistantInstallResponse,
|
|
318
|
+
json_data=payload,
|
|
319
|
+
wrap_response=False,
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
def uninstall_assistant(
|
|
323
|
+
self,
|
|
324
|
+
vendor: Union[VendorType, str],
|
|
325
|
+
ai_run_id: str,
|
|
326
|
+
) -> VendorAssistantUninstallResponse:
|
|
327
|
+
"""Uninstall/deactivate a vendor assistant.
|
|
328
|
+
|
|
329
|
+
Args:
|
|
330
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
331
|
+
ai_run_id: AI run ID returned from the install operation
|
|
332
|
+
|
|
333
|
+
Returns:
|
|
334
|
+
VendorAssistantUninstallResponse with success status
|
|
335
|
+
|
|
336
|
+
Example:
|
|
337
|
+
>>> # First, install an assistant
|
|
338
|
+
>>> install_request = VendorAssistantInstallRequest(
|
|
339
|
+
... id="TJBKR0DGWT",
|
|
340
|
+
... agentAliasId="MNULODIW4N",
|
|
341
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
342
|
+
... )
|
|
343
|
+
>>> install_response = client.vendor_assistants.install_assistants(
|
|
344
|
+
... vendor=VendorType.AWS,
|
|
345
|
+
... assistants=[install_request]
|
|
346
|
+
... )
|
|
347
|
+
>>> ai_run_id = install_response.summary[0].aiRunId
|
|
348
|
+
>>>
|
|
349
|
+
>>> # Later, uninstall the assistant using the AI run ID
|
|
350
|
+
>>> response = client.vendor_assistants.uninstall_assistant(
|
|
351
|
+
... vendor=VendorType.AWS,
|
|
352
|
+
... ai_run_id=ai_run_id
|
|
353
|
+
... )
|
|
354
|
+
>>> if response.success:
|
|
355
|
+
... print("Assistant successfully uninstalled!")
|
|
356
|
+
"""
|
|
357
|
+
# Convert enum to string value if needed
|
|
358
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
359
|
+
|
|
360
|
+
return self._api.delete(
|
|
361
|
+
f"/v1/vendors/{vendor_str}/assistants/{ai_run_id}",
|
|
362
|
+
VendorAssistantUninstallResponse,
|
|
363
|
+
wrap_response=False,
|
|
364
|
+
)
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
"""Vendor workflow service implementation for managing cloud vendor workflow settings."""
|
|
2
|
+
|
|
3
|
+
from typing import Union, Optional, List
|
|
4
|
+
|
|
5
|
+
from ..models.vendor_assistant import VendorType
|
|
6
|
+
from ..models.vendor_workflow import (
|
|
7
|
+
VendorWorkflowSettingsResponse,
|
|
8
|
+
VendorWorkflowsResponse,
|
|
9
|
+
VendorWorkflow,
|
|
10
|
+
VendorWorkflowAliasesResponse,
|
|
11
|
+
VendorWorkflowInstallRequest,
|
|
12
|
+
VendorWorkflowInstallResponse,
|
|
13
|
+
VendorWorkflowUninstallResponse,
|
|
14
|
+
)
|
|
15
|
+
from ..utils import ApiRequestHandler
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class VendorWorkflowService:
|
|
19
|
+
"""Service for managing cloud vendor workflow settings (AWS, Azure, GCP)."""
|
|
20
|
+
|
|
21
|
+
def __init__(self, api_domain: str, token: str, verify_ssl: bool = True):
|
|
22
|
+
"""Initialize the vendor workflow service.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
api_domain: Base URL for the CodeMie API
|
|
26
|
+
token: Authentication token
|
|
27
|
+
verify_ssl: Whether to verify SSL certificates
|
|
28
|
+
"""
|
|
29
|
+
self._api = ApiRequestHandler(api_domain, token, verify_ssl)
|
|
30
|
+
|
|
31
|
+
def get_workflow_settings(
|
|
32
|
+
self,
|
|
33
|
+
vendor: Union[VendorType, str],
|
|
34
|
+
page: int = 0,
|
|
35
|
+
per_page: int = 10,
|
|
36
|
+
) -> VendorWorkflowSettingsResponse:
|
|
37
|
+
"""Get workflow settings for a specific cloud vendor.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
41
|
+
page: Page number for pagination (0-based)
|
|
42
|
+
per_page: Number of items per page
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
VendorWorkflowSettingsResponse containing list of settings and pagination info
|
|
46
|
+
|
|
47
|
+
Example:
|
|
48
|
+
>>> # Using enum
|
|
49
|
+
>>> settings = client.vendor_workflows.get_workflow_settings(VendorType.AWS, page=0, per_page=10)
|
|
50
|
+
>>> # Using string
|
|
51
|
+
>>> settings = client.vendor_workflows.get_workflow_settings("aws", page=0, per_page=10)
|
|
52
|
+
>>> # Access settings data
|
|
53
|
+
>>> for setting in settings.data:
|
|
54
|
+
... print(f"Setting: {setting.setting_name}, Project: {setting.project}")
|
|
55
|
+
... if setting.invalid:
|
|
56
|
+
... print(f"Error: {setting.error}")
|
|
57
|
+
"""
|
|
58
|
+
# Convert enum to string value if needed
|
|
59
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
60
|
+
|
|
61
|
+
params = {
|
|
62
|
+
"page": page,
|
|
63
|
+
"per_page": per_page,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return self._api.get(
|
|
67
|
+
f"/v1/vendors/{vendor_str}/workflows/settings",
|
|
68
|
+
VendorWorkflowSettingsResponse,
|
|
69
|
+
params=params,
|
|
70
|
+
wrap_response=False,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
def get_workflows(
|
|
74
|
+
self,
|
|
75
|
+
vendor: Union[VendorType, str],
|
|
76
|
+
setting_id: str,
|
|
77
|
+
per_page: int = 10,
|
|
78
|
+
next_token: Optional[str] = None,
|
|
79
|
+
) -> VendorWorkflowsResponse:
|
|
80
|
+
"""Get workflows for a specific vendor setting.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
84
|
+
setting_id: ID of the vendor setting to retrieve workflows for
|
|
85
|
+
per_page: Number of items per page
|
|
86
|
+
next_token: Token for pagination (optional, for retrieving next page)
|
|
87
|
+
|
|
88
|
+
Returns:
|
|
89
|
+
VendorWorkflowsResponse containing list of workflows and pagination token
|
|
90
|
+
|
|
91
|
+
Example:
|
|
92
|
+
>>> # Get first page
|
|
93
|
+
>>> workflows = client.vendor_workflows.get_workflows(
|
|
94
|
+
... vendor=VendorType.AWS,
|
|
95
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
96
|
+
... per_page=8
|
|
97
|
+
... )
|
|
98
|
+
>>> # Access workflow data
|
|
99
|
+
>>> for workflow in workflows.data:
|
|
100
|
+
... print(f"Name: {workflow.name}, Status: {workflow.status}")
|
|
101
|
+
... print(f"Version: {workflow.version}, Description: {workflow.description}")
|
|
102
|
+
>>> # Get next page if available
|
|
103
|
+
>>> if workflows.pagination.next_token:
|
|
104
|
+
... next_page = client.vendor_workflows.get_workflows(
|
|
105
|
+
... vendor=VendorType.AWS,
|
|
106
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
107
|
+
... per_page=8,
|
|
108
|
+
... next_token=workflows.pagination.next_token
|
|
109
|
+
... )
|
|
110
|
+
"""
|
|
111
|
+
# Convert enum to string value if needed
|
|
112
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
113
|
+
|
|
114
|
+
params = {
|
|
115
|
+
"setting_id": setting_id,
|
|
116
|
+
"per_page": per_page,
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if next_token:
|
|
120
|
+
params["next_token"] = next_token
|
|
121
|
+
|
|
122
|
+
return self._api.get(
|
|
123
|
+
f"/v1/vendors/{vendor_str}/workflows",
|
|
124
|
+
VendorWorkflowsResponse,
|
|
125
|
+
params=params,
|
|
126
|
+
wrap_response=False,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
def get_workflow(
|
|
130
|
+
self,
|
|
131
|
+
vendor: Union[VendorType, str],
|
|
132
|
+
workflow_id: str,
|
|
133
|
+
setting_id: str,
|
|
134
|
+
) -> VendorWorkflow:
|
|
135
|
+
"""Get a specific workflow by ID for a vendor setting.
|
|
136
|
+
|
|
137
|
+
Args:
|
|
138
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
139
|
+
workflow_id: ID of the workflow to retrieve
|
|
140
|
+
setting_id: ID of the vendor setting
|
|
141
|
+
|
|
142
|
+
Returns:
|
|
143
|
+
VendorWorkflow containing workflow details
|
|
144
|
+
|
|
145
|
+
Example:
|
|
146
|
+
>>> workflow = client.vendor_workflows.get_workflow(
|
|
147
|
+
... vendor=VendorType.AWS,
|
|
148
|
+
... workflow_id="9HXLQ7J9YP",
|
|
149
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
150
|
+
... )
|
|
151
|
+
>>> print(f"Name: {workflow.name}, Status: {workflow.status}")
|
|
152
|
+
>>> print(f"Version: {workflow.version}, Description: {workflow.description}")
|
|
153
|
+
"""
|
|
154
|
+
# Convert enum to string value if needed
|
|
155
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
156
|
+
|
|
157
|
+
params = {
|
|
158
|
+
"setting_id": setting_id,
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return self._api.get(
|
|
162
|
+
f"/v1/vendors/{vendor_str}/workflows/{workflow_id}",
|
|
163
|
+
VendorWorkflow,
|
|
164
|
+
params=params,
|
|
165
|
+
wrap_response=False,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
def get_workflow_aliases(
|
|
169
|
+
self,
|
|
170
|
+
vendor: Union[VendorType, str],
|
|
171
|
+
workflow_id: str,
|
|
172
|
+
setting_id: str,
|
|
173
|
+
per_page: int = 10,
|
|
174
|
+
next_token: Optional[str] = None,
|
|
175
|
+
) -> VendorWorkflowAliasesResponse:
|
|
176
|
+
"""Get aliases for a specific vendor workflow.
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
180
|
+
workflow_id: ID of the workflow to retrieve aliases for
|
|
181
|
+
setting_id: ID of the vendor setting
|
|
182
|
+
per_page: Number of items per page
|
|
183
|
+
next_token: Token for pagination (optional, for retrieving next page)
|
|
184
|
+
|
|
185
|
+
Returns:
|
|
186
|
+
VendorWorkflowAliasesResponse containing list of aliases and pagination token
|
|
187
|
+
|
|
188
|
+
Example:
|
|
189
|
+
>>> # Get first page of aliases
|
|
190
|
+
>>> aliases = client.vendor_workflows.get_workflow_aliases(
|
|
191
|
+
... vendor=VendorType.AWS,
|
|
192
|
+
... workflow_id="9HXLQ7J9YP",
|
|
193
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
194
|
+
... per_page=5
|
|
195
|
+
... )
|
|
196
|
+
>>> for alias in aliases.data:
|
|
197
|
+
... print(f"{alias.name} (v{alias.version}): {alias.status}")
|
|
198
|
+
... if alias.aiRunId:
|
|
199
|
+
... print(f" AI Run ID: {alias.aiRunId}")
|
|
200
|
+
>>> # Get next page if available
|
|
201
|
+
>>> if aliases.pagination.next_token:
|
|
202
|
+
... next_page = client.vendor_workflows.get_workflow_aliases(
|
|
203
|
+
... vendor=VendorType.AWS,
|
|
204
|
+
... workflow_id="9HXLQ7J9YP",
|
|
205
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
206
|
+
... per_page=5,
|
|
207
|
+
... next_token=aliases.pagination.next_token
|
|
208
|
+
... )
|
|
209
|
+
"""
|
|
210
|
+
# Convert enum to string value if needed
|
|
211
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
212
|
+
|
|
213
|
+
params = {
|
|
214
|
+
"setting_id": setting_id,
|
|
215
|
+
"per_page": per_page,
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if next_token:
|
|
219
|
+
params["next_token"] = next_token
|
|
220
|
+
|
|
221
|
+
return self._api.get(
|
|
222
|
+
f"/v1/vendors/{vendor_str}/workflows/{workflow_id}/aliases",
|
|
223
|
+
VendorWorkflowAliasesResponse,
|
|
224
|
+
params=params,
|
|
225
|
+
wrap_response=False,
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
def install_workflows(
|
|
229
|
+
self,
|
|
230
|
+
vendor: Union[VendorType, str],
|
|
231
|
+
workflows: List[VendorWorkflowInstallRequest],
|
|
232
|
+
) -> VendorWorkflowInstallResponse:
|
|
233
|
+
"""Install/activate vendor workflows.
|
|
234
|
+
|
|
235
|
+
Args:
|
|
236
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
237
|
+
workflows: List of workflow installation requests with workflow ID, flow alias ID, and setting ID
|
|
238
|
+
|
|
239
|
+
Returns:
|
|
240
|
+
VendorWorkflowInstallResponse containing installation summary with AI run IDs
|
|
241
|
+
|
|
242
|
+
Example:
|
|
243
|
+
>>> from codemie_sdk import VendorWorkflowInstallRequest
|
|
244
|
+
>>> # Install single workflow
|
|
245
|
+
>>> install_request = VendorWorkflowInstallRequest(
|
|
246
|
+
... id="9HXLQ7J9YP",
|
|
247
|
+
... flowAliasId="9RUV0BI2L7",
|
|
248
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
249
|
+
... )
|
|
250
|
+
>>> response = client.vendor_workflows.install_workflows(
|
|
251
|
+
... vendor=VendorType.AWS,
|
|
252
|
+
... workflows=[install_request]
|
|
253
|
+
... )
|
|
254
|
+
>>> for item in response.summary:
|
|
255
|
+
... print(f"Installed workflow {item.flowId} with run ID: {item.aiRunId}")
|
|
256
|
+
>>>
|
|
257
|
+
>>> # Install multiple workflows
|
|
258
|
+
>>> requests = [
|
|
259
|
+
... VendorWorkflowInstallRequest(
|
|
260
|
+
... id="WORKFLOW_ID_1",
|
|
261
|
+
... flowAliasId="ALIAS_ID_1",
|
|
262
|
+
... setting_id="SETTING_ID"
|
|
263
|
+
... ),
|
|
264
|
+
... VendorWorkflowInstallRequest(
|
|
265
|
+
... id="WORKFLOW_ID_2",
|
|
266
|
+
... flowAliasId="ALIAS_ID_2",
|
|
267
|
+
... setting_id="SETTING_ID"
|
|
268
|
+
... )
|
|
269
|
+
... ]
|
|
270
|
+
>>> response = client.vendor_workflows.install_workflows(
|
|
271
|
+
... vendor=VendorType.AWS,
|
|
272
|
+
... workflows=requests
|
|
273
|
+
... )
|
|
274
|
+
"""
|
|
275
|
+
# Convert enum to string value if needed
|
|
276
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
277
|
+
|
|
278
|
+
# Convert list of Pydantic models to list of dicts
|
|
279
|
+
payload = [workflow.model_dump(by_alias=True) for workflow in workflows]
|
|
280
|
+
|
|
281
|
+
return self._api.post(
|
|
282
|
+
f"/v1/vendors/{vendor_str}/workflows",
|
|
283
|
+
VendorWorkflowInstallResponse,
|
|
284
|
+
json_data=payload,
|
|
285
|
+
wrap_response=False,
|
|
286
|
+
)
|
|
287
|
+
|
|
288
|
+
def uninstall_workflow(
|
|
289
|
+
self,
|
|
290
|
+
vendor: Union[VendorType, str],
|
|
291
|
+
ai_run_id: str,
|
|
292
|
+
) -> VendorWorkflowUninstallResponse:
|
|
293
|
+
"""Uninstall/deactivate a vendor workflow.
|
|
294
|
+
|
|
295
|
+
Args:
|
|
296
|
+
vendor: Cloud vendor type (aws, azure, gcp). Can be VendorType enum or string.
|
|
297
|
+
ai_run_id: AI run ID returned from the workflow alias (aiRunId field)
|
|
298
|
+
|
|
299
|
+
Returns:
|
|
300
|
+
VendorWorkflowUninstallResponse with success status
|
|
301
|
+
|
|
302
|
+
Example:
|
|
303
|
+
>>> # Get workflow aliases to find the aiRunId
|
|
304
|
+
>>> aliases = client.vendor_workflows.get_workflow_aliases(
|
|
305
|
+
... vendor=VendorType.AWS,
|
|
306
|
+
... workflow_id="9HXLQ7J9YP",
|
|
307
|
+
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
308
|
+
... )
|
|
309
|
+
>>> # Find an installed alias with aiRunId
|
|
310
|
+
>>> for alias in aliases.data:
|
|
311
|
+
... if alias.aiRunId:
|
|
312
|
+
... ai_run_id = alias.aiRunId
|
|
313
|
+
... break
|
|
314
|
+
>>>
|
|
315
|
+
>>> # Uninstall the workflow using the AI run ID
|
|
316
|
+
>>> response = client.vendor_workflows.uninstall_workflow(
|
|
317
|
+
... vendor=VendorType.AWS,
|
|
318
|
+
... ai_run_id="56fed66d-f66e-46e3-b420-bb3a8d93eed4"
|
|
319
|
+
... )
|
|
320
|
+
>>> if response.success:
|
|
321
|
+
... print("Workflow successfully uninstalled!")
|
|
322
|
+
"""
|
|
323
|
+
# Convert enum to string value if needed
|
|
324
|
+
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
325
|
+
|
|
326
|
+
return self._api.delete(
|
|
327
|
+
f"/v1/vendors/{vendor_str}/workflows/{ai_run_id}",
|
|
328
|
+
VendorWorkflowUninstallResponse,
|
|
329
|
+
wrap_response=False,
|
|
330
|
+
)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
CodeMie SDK for Python
|
|
3
|
-
~~~~~~~~~~~~~~~~~~~~~
|
|
4
|
-
|
|
5
|
-
A Python SDK for interacting with CodeMie API.
|
|
6
|
-
|
|
7
|
-
Basic usage:
|
|
8
|
-
|
|
9
|
-
>>> from codemie_sdk import CodeMieClient
|
|
10
|
-
>>> client = CodeMieClient(
|
|
11
|
-
... auth_server_url="https://auth.example.com",
|
|
12
|
-
... auth_client_id="client_id",
|
|
13
|
-
... auth_client_secret="secret",
|
|
14
|
-
... auth_realm_name="realm",
|
|
15
|
-
... codemie_api_domain="api.codemie.com"
|
|
16
|
-
... )
|
|
17
|
-
>>> assistants = client.assistants.list()
|
|
18
|
-
"""
|
|
19
|
-
|
|
20
|
-
from .client.client import CodeMieClient
|
|
21
|
-
|
|
22
|
-
__version__ = "0.2.7"
|
|
23
|
-
__all__ = ["CodeMieClient"]
|
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/auth/credentials.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/client/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/__init__.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/assistant.py
RENAMED
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/conversation.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/datasource.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/file_operation.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/integration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow.py
RENAMED
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow_state.py
RENAMED
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/assistant.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/conversation.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/integration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/webhook.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.221 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/workflow.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|