codemie-sdk-python 0.1.31__tar.gz → 0.1.33__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.31 → codemie_sdk_python-0.1.33}/PKG-INFO +1 -1
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/pyproject.toml +2 -1
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/datasource.py +3 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/integration.py +3 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/workflow.py +3 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/assistant.py +12 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/datasource.py +8 -25
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/workflow.py +4 -3
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/utils/http.py +19 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/README.md +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/__init__.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/auth/__init__.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/auth/credentials.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/client/__init__.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/client/client.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/exceptions.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/assistant.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/common.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/llm.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/task.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/user.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/workflow_state.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/integration.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/llm.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/task.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/user.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/workflow_execution.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/workflow_execution_state.py +0 -0
- {codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/utils/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "codemie-sdk-python"
|
|
3
|
-
version = "0.1.
|
|
3
|
+
version = "0.1.33"
|
|
4
4
|
description = "CodeMie SDK for Python"
|
|
5
5
|
authors = [
|
|
6
6
|
"Vadym Vlasenko <vadym_vlasenko@epam.com>",
|
|
@@ -28,6 +28,7 @@ python-gitlab = "^5.6.0"
|
|
|
28
28
|
boto3 = "^1.38.20"
|
|
29
29
|
aws-assume-role-lib = "^2.10.0"
|
|
30
30
|
pyyaml = "^6.0.2"
|
|
31
|
+
codemie-plugins = "^0.1.118"
|
|
31
32
|
|
|
32
33
|
[build-system]
|
|
33
34
|
requires = ["poetry-core"]
|
{codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/assistant.py
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Assistant service implementation."""
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
from typing import List, Union, Optional, Dict, Any, Literal
|
|
5
6
|
|
|
6
7
|
import requests
|
|
@@ -171,3 +172,14 @@ class AssistantService:
|
|
|
171
172
|
json_data=request.model_dump(exclude_none=True, by_alias=True),
|
|
172
173
|
stream=request.stream,
|
|
173
174
|
)
|
|
175
|
+
|
|
176
|
+
def upload_file_to_chat(self, file_path: Path):
|
|
177
|
+
"""Upload a file to assistant chat and return the response containing file_url."""
|
|
178
|
+
|
|
179
|
+
with open(file_path, "rb") as file:
|
|
180
|
+
files = [
|
|
181
|
+
("file", (file_path.name, file, self._api.detect_mime_type(file_path)))
|
|
182
|
+
]
|
|
183
|
+
response = self._api.post_multipart("/v1/files/", dict, files=files)
|
|
184
|
+
|
|
185
|
+
return response
|
{codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/datasource.py
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""DataSource service implementation."""
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
|
-
from typing import Literal, List, Union, Tuple
|
|
4
|
+
from typing import Literal, List, Union, Tuple, Optional, Dict, Any
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
|
|
7
7
|
from ..models.common import PaginationParams
|
|
@@ -82,7 +82,7 @@ class DatasourceService:
|
|
|
82
82
|
content = f.read()
|
|
83
83
|
|
|
84
84
|
# Basic MIME type detection
|
|
85
|
-
mime_type = self.
|
|
85
|
+
mime_type = self._api.detect_mime_type(file_path)
|
|
86
86
|
file_uploads.append(("files", (file_path.name, content, mime_type)))
|
|
87
87
|
|
|
88
88
|
elif isinstance(file_item, tuple) and len(file_item) == 3:
|
|
@@ -99,24 +99,6 @@ class DatasourceService:
|
|
|
99
99
|
endpoint, dict, params=params, files=file_uploads
|
|
100
100
|
)
|
|
101
101
|
|
|
102
|
-
@staticmethod
|
|
103
|
-
def _detect_mime_type(file_path: Path) -> str:
|
|
104
|
-
"""Detect MIME type based on file extension."""
|
|
105
|
-
extension = file_path.suffix.lower()
|
|
106
|
-
mime_types = {
|
|
107
|
-
".txt": "text/plain",
|
|
108
|
-
".csv": "text/csv",
|
|
109
|
-
".json": "application/json",
|
|
110
|
-
".yaml": "application/x-yaml",
|
|
111
|
-
".yml": "application/x-yaml",
|
|
112
|
-
".xml": "application/xml",
|
|
113
|
-
".pdf": "application/pdf",
|
|
114
|
-
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
115
|
-
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
116
|
-
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
117
|
-
}
|
|
118
|
-
return mime_types.get(extension, "application/octet-stream")
|
|
119
|
-
|
|
120
102
|
def update(self, datasource_id: str, request: BaseUpdateDataSourceRequest) -> dict:
|
|
121
103
|
"""Update an existing datasource.
|
|
122
104
|
|
|
@@ -156,6 +138,7 @@ class DatasourceService:
|
|
|
156
138
|
projects: List[str] = None,
|
|
157
139
|
owner: str = None,
|
|
158
140
|
status: DataSourceStatus = None,
|
|
141
|
+
filters: Optional[Dict[str, Any]] = None,
|
|
159
142
|
) -> List[DataSource]:
|
|
160
143
|
"""
|
|
161
144
|
List datasources with pagination and sorting support.
|
|
@@ -169,6 +152,7 @@ class DatasourceService:
|
|
|
169
152
|
projects: Optional projects to filter by.
|
|
170
153
|
owner: Optional owner to filter by in format: FirstName LastName.
|
|
171
154
|
status: Optional data source status to filter by.
|
|
155
|
+
filters: Optional filters to apply. Should be a dictionary with filter criteria.
|
|
172
156
|
|
|
173
157
|
Returns:
|
|
174
158
|
DataSourceListResponse object containing list of datasources and pagination information.
|
|
@@ -177,15 +161,14 @@ class DatasourceService:
|
|
|
177
161
|
params["sort_key"] = sort_key
|
|
178
162
|
params["sort_order"] = sort_order
|
|
179
163
|
|
|
180
|
-
filters = {}
|
|
181
164
|
if datasource_types:
|
|
182
|
-
|
|
165
|
+
params["index_type"] = datasource_types
|
|
183
166
|
if projects:
|
|
184
|
-
|
|
167
|
+
params["project"] = projects
|
|
185
168
|
if status:
|
|
186
|
-
|
|
169
|
+
params["status"] = status.value
|
|
187
170
|
if owner:
|
|
188
|
-
|
|
171
|
+
params["created_by"] = owner
|
|
189
172
|
if filters:
|
|
190
173
|
params["filters"] = json.dumps(filters)
|
|
191
174
|
return self._api.get("/v1/index", List[DataSource], params=params)
|
{codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/workflow.py
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Workflow service implementation."""
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
|
-
from typing import List, Optional
|
|
4
|
+
from typing import List, Optional, Any, Dict
|
|
5
5
|
|
|
6
6
|
from .workflow_execution import WorkflowExecutionService
|
|
7
7
|
from ..models.common import PaginationParams
|
|
@@ -81,6 +81,7 @@ class WorkflowService:
|
|
|
81
81
|
page: int = 0,
|
|
82
82
|
per_page: int = 10,
|
|
83
83
|
projects: Optional[List[str]] = None,
|
|
84
|
+
filters: Optional[Dict[str, Any]] = None,
|
|
84
85
|
) -> List[Workflow]:
|
|
85
86
|
"""List workflows with filtering and pagination support.
|
|
86
87
|
|
|
@@ -88,6 +89,7 @@ class WorkflowService:
|
|
|
88
89
|
page: Page number (0-based). Must be >= 0. Defaults to 0.
|
|
89
90
|
per_page: Number of items per page. Must be > 0. Defaults to 10.
|
|
90
91
|
projects: Optional projects to filter by.
|
|
92
|
+
filters: Optional filters to apply. Should be a dictionary with filter criteria.
|
|
91
93
|
|
|
92
94
|
Returns:
|
|
93
95
|
List of Workflow objects containing workflow information and pagination metadata.
|
|
@@ -96,9 +98,8 @@ class WorkflowService:
|
|
|
96
98
|
|
|
97
99
|
params = PaginationParams(page=page, per_page=per_page).to_dict()
|
|
98
100
|
|
|
99
|
-
filters = {}
|
|
100
101
|
if projects:
|
|
101
|
-
|
|
102
|
+
params["project"] = projects
|
|
102
103
|
if filters:
|
|
103
104
|
params["filters"] = json.dumps(filters)
|
|
104
105
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"""HTTP utilities for CodeMie SDK."""
|
|
2
2
|
|
|
3
|
+
from pathlib import Path
|
|
3
4
|
from typing import TypeVar, Type, Optional, Any, Union, Dict, List, get_origin, get_args
|
|
4
5
|
from pydantic import BaseModel
|
|
5
6
|
import requests
|
|
@@ -275,3 +276,21 @@ class ApiRequestHandler:
|
|
|
275
276
|
response.raise_for_status()
|
|
276
277
|
|
|
277
278
|
return self._parse_response(response, response_model, wrap_response)
|
|
279
|
+
|
|
280
|
+
@staticmethod
|
|
281
|
+
def detect_mime_type(file_path: Path) -> str:
|
|
282
|
+
"""Detect MIME type based on file extension."""
|
|
283
|
+
extension = file_path.suffix.lower()
|
|
284
|
+
mime_types = {
|
|
285
|
+
".txt": "text/plain",
|
|
286
|
+
".csv": "text/csv",
|
|
287
|
+
".json": "application/json",
|
|
288
|
+
".yaml": "application/x-yaml",
|
|
289
|
+
".yml": "application/x-yaml",
|
|
290
|
+
".xml": "application/xml",
|
|
291
|
+
".pdf": "application/pdf",
|
|
292
|
+
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
293
|
+
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
294
|
+
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
295
|
+
}
|
|
296
|
+
return mime_types.get(extension, "application/octet-stream")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/models/workflow_state.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.31 → codemie_sdk_python-0.1.33}/src/codemie_sdk/services/integration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|