codemie-sdk-python 0.1.199__tar.gz → 0.1.201__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.

Files changed (36) hide show
  1. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/PKG-INFO +1 -1
  2. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/pyproject.toml +1 -1
  3. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/client/client.py +4 -0
  4. codemie_sdk_python-0.1.201/src/codemie_sdk/models/file_operation.py +25 -0
  5. codemie_sdk_python-0.1.201/src/codemie_sdk/models/workflow_execution_payload.py +17 -0
  6. codemie_sdk_python-0.1.201/src/codemie_sdk/services/files.py +61 -0
  7. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/workflow.py +17 -2
  8. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/workflow_execution.py +11 -4
  9. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/README.md +0 -0
  10. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/__init__.py +0 -0
  11. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/auth/__init__.py +0 -0
  12. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/auth/credentials.py +0 -0
  13. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/client/__init__.py +0 -0
  14. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/exceptions.py +0 -0
  15. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/__init__.py +0 -0
  16. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/assistant.py +0 -0
  17. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/common.py +0 -0
  18. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/conversation.py +0 -0
  19. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/datasource.py +0 -0
  20. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/integration.py +0 -0
  21. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/llm.py +0 -0
  22. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/task.py +0 -0
  23. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/user.py +0 -0
  24. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/workflow.py +0 -0
  25. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/workflow_state.py +0 -0
  26. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/models/workflow_thoughts.py +0 -0
  27. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/assistant.py +0 -0
  28. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/conversation.py +0 -0
  29. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/datasource.py +0 -0
  30. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/integration.py +0 -0
  31. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/llm.py +0 -0
  32. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/task.py +0 -0
  33. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/user.py +0 -0
  34. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/services/workflow_execution_state.py +0 -0
  35. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/utils/__init__.py +0 -0
  36. {codemie_sdk_python-0.1.199 → codemie_sdk_python-0.1.201}/src/codemie_sdk/utils/http.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codemie-sdk-python
3
- Version: 0.1.199
3
+ Version: 0.1.201
4
4
  Summary: CodeMie SDK for Python
5
5
  Author: Vadym Vlasenko
6
6
  Author-email: vadym_vlasenko@epam.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "codemie-sdk-python"
3
- version = "0.1.199"
3
+ version = "0.1.201"
4
4
  description = "CodeMie SDK for Python"
5
5
  authors = [
6
6
  "Vadym Vlasenko <vadym_vlasenko@epam.com>",
@@ -11,6 +11,7 @@ from ..services.integration import IntegrationService
11
11
  from ..services.task import TaskService
12
12
  from ..services.user import UserService
13
13
  from ..services.workflow import WorkflowService
14
+ from ..services.files import FileOperationService
14
15
 
15
16
 
16
17
  class CodeMieClient:
@@ -81,6 +82,9 @@ class CodeMieClient:
81
82
  self.conversations = ConversationService(
82
83
  self._api_domain, self._token, verify_ssl=self._verify_ssl
83
84
  )
85
+ self.files = FileOperationService(
86
+ self._api_domain, self._token, verify_ssl=self._verify_ssl
87
+ )
84
88
 
85
89
  @property
86
90
  def token(self) -> str:
@@ -0,0 +1,25 @@
1
+ """File operation models."""
2
+
3
+ from typing import Optional, List, Any, Dict
4
+ from pydantic import BaseModel, ConfigDict, Field
5
+
6
+
7
+ class FileResponse(BaseModel):
8
+ """Individual file response model."""
9
+
10
+ model_config = ConfigDict(extra="ignore")
11
+
12
+ file_url: str = Field(..., description="URL or identifier for the uploaded file")
13
+
14
+
15
+ class FileBulkCreateResponse(BaseModel):
16
+ """Response model for bulk file creation."""
17
+
18
+ model_config = ConfigDict(extra="ignore")
19
+
20
+ files: List[FileResponse] = Field(
21
+ ..., description="List of successfully uploaded files with their URLs"
22
+ )
23
+ failed_files: Optional[List[Dict[str, Any]]] = Field(
24
+ None, description="List of files that failed to upload, null if no failures"
25
+ )
@@ -0,0 +1,17 @@
1
+ """Workflow execution payload models."""
2
+
3
+ from typing import Optional
4
+ from pydantic import BaseModel, ConfigDict, Field
5
+
6
+
7
+ class WorkflowExecutionCreateRequest(BaseModel):
8
+ """Request model for workflow execution creation."""
9
+
10
+ model_config = ConfigDict(populate_by_name=True)
11
+
12
+ user_input: Optional[str] = Field(
13
+ None, description="User input for the workflow execution"
14
+ )
15
+ file_name: Optional[str] = Field(
16
+ None, description="File name associated with the workflow execution"
17
+ )
@@ -0,0 +1,61 @@
1
+ """File operation service implementation."""
2
+
3
+ import mimetypes
4
+ from pathlib import Path
5
+ from typing import List
6
+
7
+ from ..models.file_operation import FileBulkCreateResponse
8
+ from ..utils import ApiRequestHandler
9
+
10
+
11
+ class FileOperationService:
12
+ """Service for managing file operations."""
13
+
14
+ def __init__(self, api_domain: str, token: str, verify_ssl: bool = True):
15
+ """Initialize the file operation service.
16
+
17
+ Args:
18
+ api_domain: Base URL for the CodeMie API
19
+ token: Authentication token
20
+ verify_ssl: Whether to verify SSL certificates
21
+ """
22
+ self._api = ApiRequestHandler(api_domain, token, verify_ssl)
23
+
24
+ def bulk_upload(self, files: List[Path]) -> FileBulkCreateResponse:
25
+ """Upload multiple files in a single operation.
26
+
27
+ Args:
28
+ files: List of File paths (required)
29
+
30
+ Returns:
31
+ FileBulkCreateResponse: Results of the bulk operation including
32
+
33
+ Raises:
34
+ ValueError: If items in files is not a Path
35
+ ApiError: If bulk creation fails or validation errors occur
36
+ """
37
+
38
+ files_to_upload = []
39
+
40
+ for file_path in files:
41
+ if isinstance(file_path, Path):
42
+ # File path provided - read file and detect MIME type
43
+ with open(file_path, "rb") as file:
44
+ content = file.read()
45
+
46
+ # Basic MIME type detection
47
+ mime_type = (
48
+ mimetypes.guess_type(file_path.name)[0]
49
+ or "application/octet-stream"
50
+ )
51
+ files_to_upload.append(("files", (file_path.name, content, mime_type)))
52
+ else:
53
+ raise ValueError("Each item in list must be a Path")
54
+
55
+ response = self._api.post_multipart(
56
+ "/v1/files/bulk",
57
+ files=files_to_upload,
58
+ response_model=FileBulkCreateResponse,
59
+ )
60
+
61
+ return response
@@ -130,8 +130,23 @@ class WorkflowService:
130
130
  """
131
131
  return self._api.delete(f"/v1/workflows/{workflow_id}", dict)
132
132
 
133
- def run(self, workflow_id: str, user_input: str = "") -> dict:
134
- return self.executions(workflow_id).create(user_input)
133
+ def run(
134
+ self,
135
+ workflow_id: str,
136
+ user_input: Optional[str] = None,
137
+ file_name: Optional[str] = None,
138
+ ) -> dict:
139
+ """Run a workflow with optional input parameters.
140
+
141
+ Args:
142
+ workflow_id: ID of the workflow to run
143
+ user_input: Optional user input for the workflow execution
144
+ file_name: Optional file name for the workflow execution
145
+
146
+ Returns:
147
+ dict: Created workflow execution details
148
+ """
149
+ return self.executions(workflow_id).create(user_input, file_name)
135
150
 
136
151
  def executions(self, workflow_id: str) -> WorkflowExecutionService:
137
152
  """Get workflow execution service for the specified workflow.
@@ -4,6 +4,7 @@ from typing import List, Optional
4
4
 
5
5
  from ..models.common import PaginationParams
6
6
  from ..models.workflow import WorkflowExecution
7
+ from ..models.workflow_execution_payload import WorkflowExecutionCreateRequest
7
8
  from ..models.workflow_thoughts import WorkflowExecutionThought
8
9
  from .workflow_execution_state import WorkflowExecutionStateService
9
10
  from ..utils import ApiRequestHandler
@@ -44,19 +45,25 @@ class WorkflowExecutionService:
44
45
  params=params,
45
46
  )
46
47
 
47
- def create(self, user_input: Optional[str] = "") -> dict:
48
+ def create(
49
+ self, user_input: Optional[str] = None, file_name: Optional[str] = None
50
+ ) -> dict:
48
51
  """Create a new workflow execution.
49
52
 
50
53
  Args:
51
54
  user_input: Optional input data for the workflow execution.
52
- Defaults to None.
55
+ file_name: Optional file name associated with the workflow execution.
53
56
 
54
57
  Returns:
55
58
  dict: Created workflow execution details
56
59
  """
57
- payload = {"user_input": user_input}
60
+ payload = WorkflowExecutionCreateRequest(
61
+ user_input=user_input, file_name=file_name
62
+ )
58
63
  return self._api.post(
59
- f"/v1/workflows/{self._workflow_id}/executions", dict, json_data=payload
64
+ f"/v1/workflows/{self._workflow_id}/executions",
65
+ dict,
66
+ json_data=payload.model_dump(),
60
67
  )
61
68
 
62
69
  def get(self, execution_id: str) -> WorkflowExecution: