codemie-sdk-python 0.1.30__tar.gz → 0.1.32__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.30 → codemie_sdk_python-0.1.32}/PKG-INFO +1 -1
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/pyproject.toml +2 -1
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/assistant.py +12 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/datasource.py +1 -19
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/utils/http.py +19 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/README.md +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/__init__.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/auth/__init__.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/auth/credentials.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/client/__init__.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/client/client.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/exceptions.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/assistant.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/common.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/datasource.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/integration.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/llm.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/task.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/user.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/workflow.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/workflow_state.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/integration.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/llm.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/task.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/user.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/workflow.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/workflow_execution.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/workflow_execution_state.py +0 -0
- {codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/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.32"
|
|
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.30 → codemie_sdk_python-0.1.32}/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.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/datasource.py
RENAMED
|
@@ -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
|
|
|
@@ -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
|
{codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/datasource.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/integration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/models/workflow_state.py
RENAMED
|
File without changes
|
{codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/integration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{codemie_sdk_python-0.1.30 → codemie_sdk_python-0.1.32}/src/codemie_sdk/services/workflow.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|