codemie-sdk-python 0.1.222__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.222 → codemie_sdk_python-0.1.223}/PKG-INFO +1 -1
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/pyproject.toml +1 -1
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/__init__.py +29 -3
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/client/client.py +10 -3
- codemie_sdk_python-0.1.223/src/codemie_sdk/models/vendor_workflow.py +145 -0
- codemie_sdk_python-0.1.222/src/codemie_sdk/services/vendor.py → codemie_sdk_python-0.1.223/src/codemie_sdk/services/vendor_assistant.py +13 -13
- codemie_sdk_python-0.1.223/src/codemie_sdk/services/vendor_workflow.py +330 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/README.md +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/auth/__init__.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/auth/credentials.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/client/__init__.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/exceptions.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/__init__.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/assistant.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/common.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/conversation.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/datasource.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/file_operation.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/integration.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/llm.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/task.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/user.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/vendor_assistant.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow_execution_payload.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow_state.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow_thoughts.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/assistant.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/conversation.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/datasource.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/files.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/integration.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/llm.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/task.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/user.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/webhook.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/workflow.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/workflow_execution.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/workflow_execution_state.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/utils/__init__.py +0 -0
- {codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/utils/http.py +0 -0
|
@@ -35,9 +35,23 @@ 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 .services.vendor_assistant import VendorAssistantService
|
|
52
|
+
from .services.vendor_workflow import VendorWorkflowService
|
|
39
53
|
|
|
40
|
-
__version__ = "0.2.
|
|
54
|
+
__version__ = "0.2.10"
|
|
41
55
|
__all__ = [
|
|
42
56
|
"CodeMieClient",
|
|
43
57
|
"VendorType",
|
|
@@ -55,5 +69,17 @@ __all__ = [
|
|
|
55
69
|
"VendorAssistantUninstallResponse",
|
|
56
70
|
"PaginationInfo",
|
|
57
71
|
"TokenPagination",
|
|
58
|
-
"
|
|
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",
|
|
59
85
|
]
|
|
@@ -13,7 +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.
|
|
16
|
+
from ..services.vendor_assistant import VendorAssistantService
|
|
17
|
+
from ..services.vendor_workflow import VendorWorkflowService
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
class CodeMieClient:
|
|
@@ -90,7 +91,10 @@ class CodeMieClient:
|
|
|
90
91
|
self.webhook = WebhookService(
|
|
91
92
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
92
93
|
)
|
|
93
|
-
self.
|
|
94
|
+
self.vendor_assistants = VendorAssistantService(
|
|
95
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
96
|
+
)
|
|
97
|
+
self.vendor_workflows = VendorWorkflowService(
|
|
94
98
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
95
99
|
)
|
|
96
100
|
|
|
@@ -139,7 +143,10 @@ class CodeMieClient:
|
|
|
139
143
|
self.conversations = ConversationService(
|
|
140
144
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
141
145
|
)
|
|
142
|
-
self.
|
|
146
|
+
self.vendor_assistants = VendorAssistantService(
|
|
147
|
+
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
148
|
+
)
|
|
149
|
+
self.vendor_workflows = VendorWorkflowService(
|
|
143
150
|
self._api_domain, self._token, verify_ssl=self._verify_ssl
|
|
144
151
|
)
|
|
145
152
|
return self._token
|
|
@@ -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")
|
|
@@ -16,7 +16,7 @@ from ..models.vendor_assistant import (
|
|
|
16
16
|
from ..utils import ApiRequestHandler
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
class
|
|
19
|
+
class VendorAssistantService:
|
|
20
20
|
"""Service for managing cloud vendor assistant settings (AWS, Azure, GCP)."""
|
|
21
21
|
|
|
22
22
|
def __init__(self, api_domain: str, token: str, verify_ssl: bool = True):
|
|
@@ -47,9 +47,9 @@ class VendorService:
|
|
|
47
47
|
|
|
48
48
|
Example:
|
|
49
49
|
>>> # Using enum
|
|
50
|
-
>>> settings = client.
|
|
50
|
+
>>> settings = client.vendor_assistants.get_assistant_settings(VendorType.AWS, page=0, per_page=10)
|
|
51
51
|
>>> # Using string
|
|
52
|
-
>>> settings = client.
|
|
52
|
+
>>> settings = client.vendor_assistants.get_assistant_settings("aws", page=0, per_page=10)
|
|
53
53
|
"""
|
|
54
54
|
# Convert enum to string value if needed
|
|
55
55
|
vendor_str = vendor.value if isinstance(vendor, VendorType) else vendor
|
|
@@ -86,14 +86,14 @@ class VendorService:
|
|
|
86
86
|
|
|
87
87
|
Example:
|
|
88
88
|
>>> # Get first page
|
|
89
|
-
>>> assistants = client.
|
|
89
|
+
>>> assistants = client.vendor_assistants.get_assistants(
|
|
90
90
|
... vendor=VendorType.AWS,
|
|
91
91
|
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
92
92
|
... per_page=8
|
|
93
93
|
... )
|
|
94
94
|
>>> # Get next page if available
|
|
95
95
|
>>> if assistants.pagination.next_token:
|
|
96
|
-
... next_page = client.
|
|
96
|
+
... next_page = client.vendor_assistants.get_assistants(
|
|
97
97
|
... vendor=VendorType.AWS,
|
|
98
98
|
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
99
99
|
... per_page=8,
|
|
@@ -135,7 +135,7 @@ class VendorService:
|
|
|
135
135
|
VendorAssistant containing assistant details
|
|
136
136
|
|
|
137
137
|
Example:
|
|
138
|
-
>>> assistant = client.
|
|
138
|
+
>>> assistant = client.vendor_assistants.get_assistant(
|
|
139
139
|
... vendor=VendorType.AWS,
|
|
140
140
|
... assistant_id="TJBKR0DGWT",
|
|
141
141
|
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
@@ -176,7 +176,7 @@ class VendorService:
|
|
|
176
176
|
instruction, foundation model, and timestamps
|
|
177
177
|
|
|
178
178
|
Example:
|
|
179
|
-
>>> version_details = client.
|
|
179
|
+
>>> version_details = client.vendor_assistants.get_assistant_version(
|
|
180
180
|
... vendor=VendorType.AWS,
|
|
181
181
|
... assistant_id="TJBKR0DGWT",
|
|
182
182
|
... version="1",
|
|
@@ -223,7 +223,7 @@ class VendorService:
|
|
|
223
223
|
|
|
224
224
|
Example:
|
|
225
225
|
>>> # Get first page of aliases
|
|
226
|
-
>>> aliases = client.
|
|
226
|
+
>>> aliases = client.vendor_assistants.get_assistant_aliases(
|
|
227
227
|
... vendor=VendorType.AWS,
|
|
228
228
|
... assistant_id="TJBKR0DGWT",
|
|
229
229
|
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
@@ -233,7 +233,7 @@ class VendorService:
|
|
|
233
233
|
... print(f"{alias.name} (v{alias.version}): {alias.status}")
|
|
234
234
|
>>> # Get next page if available
|
|
235
235
|
>>> if aliases.pagination.next_token:
|
|
236
|
-
... next_page = client.
|
|
236
|
+
... next_page = client.vendor_assistants.get_assistant_aliases(
|
|
237
237
|
... vendor=VendorType.AWS,
|
|
238
238
|
... assistant_id="TJBKR0DGWT",
|
|
239
239
|
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
@@ -281,7 +281,7 @@ class VendorService:
|
|
|
281
281
|
... agentAliasId="MNULODIW4N",
|
|
282
282
|
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
283
283
|
... )
|
|
284
|
-
>>> response = client.
|
|
284
|
+
>>> response = client.vendor_assistants.install_assistants(
|
|
285
285
|
... vendor=VendorType.AWS,
|
|
286
286
|
... assistants=[install_request]
|
|
287
287
|
... )
|
|
@@ -301,7 +301,7 @@ class VendorService:
|
|
|
301
301
|
... setting_id="SETTING_ID"
|
|
302
302
|
... )
|
|
303
303
|
... ]
|
|
304
|
-
>>> response = client.
|
|
304
|
+
>>> response = client.vendor_assistants.install_assistants(
|
|
305
305
|
... vendor=VendorType.AWS,
|
|
306
306
|
... assistants=requests
|
|
307
307
|
... )
|
|
@@ -340,14 +340,14 @@ class VendorService:
|
|
|
340
340
|
... agentAliasId="MNULODIW4N",
|
|
341
341
|
... setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c"
|
|
342
342
|
... )
|
|
343
|
-
>>> install_response = client.
|
|
343
|
+
>>> install_response = client.vendor_assistants.install_assistants(
|
|
344
344
|
... vendor=VendorType.AWS,
|
|
345
345
|
... assistants=[install_request]
|
|
346
346
|
... )
|
|
347
347
|
>>> ai_run_id = install_response.summary[0].aiRunId
|
|
348
348
|
>>>
|
|
349
349
|
>>> # Later, uninstall the assistant using the AI run ID
|
|
350
|
-
>>> response = client.
|
|
350
|
+
>>> response = client.vendor_assistants.uninstall_assistant(
|
|
351
351
|
... vendor=VendorType.AWS,
|
|
352
352
|
... ai_run_id=ai_run_id
|
|
353
353
|
... )
|
|
@@ -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
|
+
)
|
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/auth/credentials.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/client/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/__init__.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/assistant.py
RENAMED
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/conversation.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/datasource.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/file_operation.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.222 → 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.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/vendor_assistant.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/models/workflow.py
RENAMED
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.222 → 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.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/assistant.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/conversation.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.222 → 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.222 → codemie_sdk_python-0.1.223}/src/codemie_sdk/services/webhook.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.222 → 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
|