codemie-sdk-python 0.1.204__py3-none-any.whl → 0.1.230__py3-none-any.whl
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/__init__.py +114 -2
- codemie_sdk/client/client.py +32 -0
- codemie_sdk/models/assistant.py +29 -0
- codemie_sdk/models/datasource.py +1 -0
- codemie_sdk/models/vendor_assistant.py +187 -0
- codemie_sdk/models/vendor_guardrail.py +152 -0
- codemie_sdk/models/vendor_knowledgebase.py +151 -0
- codemie_sdk/models/vendor_workflow.py +145 -0
- codemie_sdk/models/workflow_execution_payload.py +6 -2
- codemie_sdk/services/assistant.py +219 -2
- codemie_sdk/services/vendor_assistant.py +364 -0
- codemie_sdk/services/vendor_guardrail.py +375 -0
- codemie_sdk/services/vendor_knowledgebase.py +270 -0
- codemie_sdk/services/vendor_workflow.py +330 -0
- codemie_sdk/services/webhook.py +41 -0
- codemie_sdk/services/workflow.py +10 -1
- codemie_sdk/services/workflow_execution.py +26 -4
- codemie_sdk/utils/http.py +20 -3
- {codemie_sdk_python-0.1.204.dist-info → codemie_sdk_python-0.1.230.dist-info}/METADATA +108 -10
- {codemie_sdk_python-0.1.204.dist-info → codemie_sdk_python-0.1.230.dist-info}/RECORD +21 -12
- {codemie_sdk_python-0.1.204.dist-info → codemie_sdk_python-0.1.230.dist-info}/WHEEL +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: codemie-sdk-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.230
|
|
4
4
|
Summary: CodeMie SDK for Python
|
|
5
5
|
Author: Vadym Vlasenko
|
|
6
6
|
Author-email: vadym_vlasenko@epam.com
|
|
@@ -43,6 +43,8 @@ Python SDK for CodeMie services. This SDK provides a comprehensive interface to
|
|
|
43
43
|
- [Workflow Status Monitoring](#workflow-status-monitoring)
|
|
44
44
|
- [Conversation Service](#conversation-service)
|
|
45
45
|
- [Core Methods](#core-methods-4)
|
|
46
|
+
- [Webhook Service](#webhook-service)
|
|
47
|
+
- [Core Methods](#core-methods-5)
|
|
46
48
|
- [Development](#development)
|
|
47
49
|
- [Setup](#setup)
|
|
48
50
|
- [Running Tests](#running-tests)
|
|
@@ -57,7 +59,7 @@ Python SDK for CodeMie services. This SDK provides a comprehensive interface to
|
|
|
57
59
|
## Installation
|
|
58
60
|
|
|
59
61
|
```sh
|
|
60
|
-
pip install codemie-sdk
|
|
62
|
+
pip install codemie-sdk-python
|
|
61
63
|
```
|
|
62
64
|
OR
|
|
63
65
|
```sh
|
|
@@ -172,16 +174,41 @@ result = client.assistant.delete("assistant-id")
|
|
|
172
174
|
|
|
173
175
|
#### Advanced Features
|
|
174
176
|
|
|
175
|
-
6. **Chat with Assistant**
|
|
177
|
+
6. **Chat with Assistant (with MCP header propagation)**
|
|
176
178
|
```python
|
|
177
179
|
from codemie_sdk.models.assistant import AssistantChatRequest
|
|
178
180
|
|
|
179
181
|
chat_request = AssistantChatRequest(
|
|
180
182
|
text="Your message here",
|
|
181
183
|
stream=False, # Set to True for streaming response
|
|
182
|
-
#
|
|
184
|
+
propagate_headers=True, # Enable propagation of X-* headers to MCP servers
|
|
185
|
+
)
|
|
186
|
+
# Pass X-* headers to forward to MCP servers
|
|
187
|
+
response = client.assistant.chat(
|
|
188
|
+
"assistant-id",
|
|
189
|
+
chat_request,
|
|
190
|
+
headers={
|
|
191
|
+
"X-Tenant-ID": "tenant-abc-123",
|
|
192
|
+
"X-User-ID": "user-456",
|
|
193
|
+
"X-Request-ID": "req-123",
|
|
194
|
+
},
|
|
195
|
+
)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
6.a. **Chat with Assistant by slug (with MCP header propagation)**
|
|
199
|
+
```python
|
|
200
|
+
chat_request = AssistantChatRequest(
|
|
201
|
+
text="Your message here",
|
|
202
|
+
propagate_headers=True,
|
|
203
|
+
)
|
|
204
|
+
response = client.assistants.chat_by_slug(
|
|
205
|
+
"assistant-slug",
|
|
206
|
+
chat_request,
|
|
207
|
+
headers={
|
|
208
|
+
"X-Environment": "production",
|
|
209
|
+
"X-Feature-Flag-Beta": "true",
|
|
210
|
+
},
|
|
183
211
|
)
|
|
184
|
-
response = client.assistant.chat("assistant-id", chat_request)
|
|
185
212
|
```
|
|
186
213
|
|
|
187
214
|
7. **Utilize structured outputs with Assistant**
|
|
@@ -546,10 +573,18 @@ result = client.workflow.delete("workflow-id")
|
|
|
546
573
|
|
|
547
574
|
The SDK provides comprehensive workflow execution management through the WorkflowExecutionService:
|
|
548
575
|
|
|
549
|
-
1. **Run Workflow**
|
|
576
|
+
1. **Run Workflow (with MCP header propagation)**
|
|
550
577
|
```python
|
|
551
|
-
#
|
|
552
|
-
execution = client.workflow.run(
|
|
578
|
+
# Enable propagation in payload and pass X-* headers to forward to MCP servers
|
|
579
|
+
execution = client.workflow.run(
|
|
580
|
+
"workflow-id",
|
|
581
|
+
user_input="optional input",
|
|
582
|
+
propagate_headers=True,
|
|
583
|
+
headers={
|
|
584
|
+
"X-Request-ID": "req-abc-123",
|
|
585
|
+
"X-Source-App": "analytics-ui",
|
|
586
|
+
},
|
|
587
|
+
)
|
|
553
588
|
|
|
554
589
|
# Get execution service for advanced operations
|
|
555
590
|
execution_service = client.workflow.executions("workflow-id")
|
|
@@ -569,8 +604,14 @@ execution = execution_service.get("execution-id")
|
|
|
569
604
|
# Abort running execution
|
|
570
605
|
result = execution_service.abort("execution-id")
|
|
571
606
|
|
|
572
|
-
# Resume interrupted execution
|
|
573
|
-
result = execution_service.resume(
|
|
607
|
+
# Resume interrupted execution with header propagation (query param + headers)
|
|
608
|
+
result = execution_service.resume(
|
|
609
|
+
"execution-id",
|
|
610
|
+
propagate_headers=True,
|
|
611
|
+
headers={
|
|
612
|
+
"X-Correlation-ID": "corr-456",
|
|
613
|
+
},
|
|
614
|
+
)
|
|
574
615
|
|
|
575
616
|
# Delete all executions
|
|
576
617
|
result = execution_service.delete_all()
|
|
@@ -735,6 +776,19 @@ client.conversations.list_by_assistant_id("assistant-id")
|
|
|
735
776
|
client.conversations.delete("conversation-id")
|
|
736
777
|
```
|
|
737
778
|
|
|
779
|
+
|
|
780
|
+
### Webhook Service
|
|
781
|
+
|
|
782
|
+
The Webhook service provides access to trigger available webhook in CodeMie.
|
|
783
|
+
|
|
784
|
+
#### Core Methods
|
|
785
|
+
|
|
786
|
+
1. **Get All Conversations**
|
|
787
|
+
```python
|
|
788
|
+
# Trigger assistant/workflow/datasource by it's ID
|
|
789
|
+
# Data - body of the post method
|
|
790
|
+
response = client.webhook.trigger("resource_id", "data")
|
|
791
|
+
```
|
|
738
792
|
## Error Handling
|
|
739
793
|
|
|
740
794
|
The SDK implements comprehensive error handling. All API calls may raise exceptions for:
|
|
@@ -816,6 +870,50 @@ client = CodeMieClient(
|
|
|
816
870
|
)
|
|
817
871
|
```
|
|
818
872
|
|
|
873
|
+
### Assistant Versioning via SDK
|
|
874
|
+
|
|
875
|
+
The Python SDK exposes full assistant versioning capabilities delivered in EPMCDME-8285.
|
|
876
|
+
|
|
877
|
+
- List versions
|
|
878
|
+
```python
|
|
879
|
+
versions = client.assistants.list_versions("assistant-id", page=0, per_page=20)
|
|
880
|
+
print([v.version_number for v in versions])
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
- Get specific version
|
|
884
|
+
```python
|
|
885
|
+
version = client.assistants.get_version("assistant-id", 2)
|
|
886
|
+
print(version.system_prompt)
|
|
887
|
+
```
|
|
888
|
+
|
|
889
|
+
- Compare two versions
|
|
890
|
+
```python
|
|
891
|
+
from codemie_sdk.models.assistant import AssistantVersionDiff
|
|
892
|
+
|
|
893
|
+
diff: AssistantVersionDiff = client.assistants.compare_versions("assistant-id", 1, 3)
|
|
894
|
+
print(diff.summary)
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
- Rollback to a version
|
|
898
|
+
```python
|
|
899
|
+
resp = client.assistants.rollback_to_version("assistant-id", 2)
|
|
900
|
+
print(resp)
|
|
901
|
+
```
|
|
902
|
+
|
|
903
|
+
- Chat with a specific version
|
|
904
|
+
```python
|
|
905
|
+
from codemie_sdk.models.assistant import AssistantChatRequest
|
|
906
|
+
|
|
907
|
+
req = AssistantChatRequest(text="Hi", stream=False)
|
|
908
|
+
resp = client.assistants.chat_with_version("assistant-id", 2, req)
|
|
909
|
+
print(resp.generated)
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
Quick CLI example
|
|
913
|
+
```bash
|
|
914
|
+
python codemie-sdk/examples/assistant_versions.py <assistant_id> [version_number]
|
|
915
|
+
```
|
|
916
|
+
|
|
819
917
|
## Support
|
|
820
918
|
For providing credentials please contact AI/Run CodeMie Team: Vadym_Vlasenko@epam.com or Nikita_Levyankov@epam.com
|
|
821
919
|
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
codemie_sdk/__init__.py,sha256=
|
|
1
|
+
codemie_sdk/__init__.py,sha256=rdb72JEOkNMYrVYgnahqFpp7I6FgbmeWuNflMKWetgE,4168
|
|
2
2
|
codemie_sdk/auth/__init__.py,sha256=IksEj223xEZtJ-cQ0AT9L0Bs9psIJ8QNzDXrPTUQ3xQ,126
|
|
3
3
|
codemie_sdk/auth/credentials.py,sha256=OzR_CXPBNTEC6VmNdzcCHF7rWWGrVf3agAlGKgPtTiU,4361
|
|
4
4
|
codemie_sdk/client/__init__.py,sha256=yf6C39MmrJ6gK9ZHMhBeynKwUUYVSUTQbKxU8-4qpKg,101
|
|
5
|
-
codemie_sdk/client/client.py,sha256=
|
|
5
|
+
codemie_sdk/client/client.py,sha256=T0Xdf8mZB-f7Eh4XcJzP9Vs4Jfkeqv975uf4pCWzGY8,6888
|
|
6
6
|
codemie_sdk/exceptions.py,sha256=XoVPyognx-JmyVxLHkZPAcX1CMi1OoT1diBFJLU54so,1183
|
|
7
7
|
codemie_sdk/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
codemie_sdk/models/assistant.py,sha256=
|
|
8
|
+
codemie_sdk/models/assistant.py,sha256=6D2utlcZn9XyrkWGAjT5FLEYETgBdSEcnRg-T6GhiHk,12036
|
|
9
9
|
codemie_sdk/models/common.py,sha256=gmZ-ps8TbaieNKr0kUKoQEjhVrHD2CAYomOpZQRatH8,1195
|
|
10
10
|
codemie_sdk/models/conversation.py,sha256=tGlqtVnoRCbTm8J8Y1BUmBvMpLW3IRFE0CIHJYoNU_Y,4238
|
|
11
|
-
codemie_sdk/models/datasource.py,sha256=
|
|
11
|
+
codemie_sdk/models/datasource.py,sha256=vUDv7xYlouy9gLiITKANHlCh48Gu1dajJ8TGuGAE-2Y,10900
|
|
12
12
|
codemie_sdk/models/file_operation.py,sha256=D2hnsxOO9lzVMw0BNCgKPfHf28bWQmbw5rccgaTXI90,747
|
|
13
13
|
codemie_sdk/models/integration.py,sha256=IxTbbyEHsD8HWWFDtZDoWuE1ZwR9wwiBk3XUwlf1KZI,2328
|
|
14
14
|
codemie_sdk/models/llm.py,sha256=ppb9-1dx1UFhRuJpSR3ij7H6Pfhe9nO4C4BEOIbToy4,1192
|
|
15
15
|
codemie_sdk/models/task.py,sha256=J4ZFRY3s8qBGrqB5NLQF0rMbInLh4s7OEZ0ZfmnW0Ho,1476
|
|
16
16
|
codemie_sdk/models/user.py,sha256=Q0rjimZh-IbeaPfq6b6fk6ZaCtwLqWHEIlU863suCS4,1777
|
|
17
|
+
codemie_sdk/models/vendor_assistant.py,sha256=4xPBwE-x2eWNNHAVsdOrZSDKvvp4UqlsunR0Q9pQccc,6409
|
|
18
|
+
codemie_sdk/models/vendor_guardrail.py,sha256=ThttN224rvievqUxTmFTKjIxose-VW_mYopwF-WOzd4,5279
|
|
19
|
+
codemie_sdk/models/vendor_knowledgebase.py,sha256=uRfKRaOPh71IMSJMFB-9Kki01TVtGbEjF_wupTvDG58,5051
|
|
20
|
+
codemie_sdk/models/vendor_workflow.py,sha256=EbBwpj4lDLsYawrflomDW0KcHUXN-34FKPqQBVQYJ4I,4975
|
|
17
21
|
codemie_sdk/models/workflow.py,sha256=qfk0rBJnFUMpcEDq_E5GB3hzYKbe_bb2NYJlLZJwUEE,2453
|
|
18
|
-
codemie_sdk/models/workflow_execution_payload.py,sha256=
|
|
22
|
+
codemie_sdk/models/workflow_execution_payload.py,sha256=Pa28ElqsJLudscJnmZhXUEJWJXLw55xc-KYBPi97EZ4,724
|
|
19
23
|
codemie_sdk/models/workflow_state.py,sha256=okEMKzkiBU3GHs9VNBoiEMOnOeZRMXGYtpL0NYSg-FY,1374
|
|
20
24
|
codemie_sdk/models/workflow_thoughts.py,sha256=CjHaIPgca9kQAjpoq8IpX4MuDeql1SvaoKS5RmyU2SE,616
|
|
21
|
-
codemie_sdk/services/assistant.py,sha256=
|
|
25
|
+
codemie_sdk/services/assistant.py,sha256=hbKW2gweGMcOQCXbhrkgI__gwuPgZk0jz1GzJ7kH8Dw,15940
|
|
22
26
|
codemie_sdk/services/conversation.py,sha256=Ss0mkGaBi4u8-YKzhRYUJOfoFqJueDp9JurI5DRCGT8,2566
|
|
23
27
|
codemie_sdk/services/datasource.py,sha256=d8LImpireGOnXKvj4h8iafq_ZQMn177_GGLLiE5g7wU,7405
|
|
24
28
|
codemie_sdk/services/files.py,sha256=MKLJEv208yUkeRO2JfC4XWPeJ4TKg5ZGaxaBU5GXzoM,1955
|
|
@@ -26,11 +30,16 @@ codemie_sdk/services/integration.py,sha256=SdwFwR3hCPyJYilzzlkpKPLNbO89nfqmIXXoT
|
|
|
26
30
|
codemie_sdk/services/llm.py,sha256=0-e4_7RvLHs2giCyoQ5U4KDTh6p5VXgPKNxnDP9ZDFU,1100
|
|
27
31
|
codemie_sdk/services/task.py,sha256=3e9t8_LMkR4xfeMBwMCo7ZF87PxPS-ZbzDg85ilda2M,1031
|
|
28
32
|
codemie_sdk/services/user.py,sha256=7B-Qw451qKPD5Io6qLda-kbFDaPRQ3TamJamiGwCQu4,1013
|
|
29
|
-
codemie_sdk/services/
|
|
30
|
-
codemie_sdk/services/
|
|
33
|
+
codemie_sdk/services/vendor_assistant.py,sha256=QP8Qgo1rb0ak199mACFmNN2qrnYMAefs3VIBB5uHJxg,13485
|
|
34
|
+
codemie_sdk/services/vendor_guardrail.py,sha256=ZQGgBfe-pN9cBIt-e3ud99UF7iChtwZuJRJv-3W_Eew,14281
|
|
35
|
+
codemie_sdk/services/vendor_knowledgebase.py,sha256=wHLUexRwX-5V-GZcfdoMwjMiCPE4gD5w6D8A1YvB21E,10413
|
|
36
|
+
codemie_sdk/services/vendor_workflow.py,sha256=h-UlEnYjV8d0EoEPb9BgMdxPBJvtY0KUZXLQfqYeqX4,12453
|
|
37
|
+
codemie_sdk/services/webhook.py,sha256=QhRKo7y9BcboYJm_cPdPqYDhmv_OWTf9eodsT3UkAjM,1210
|
|
38
|
+
codemie_sdk/services/workflow.py,sha256=3YQjjf8YhZZKt-Oyt3DViDChRXWqHSGwDETO3XYnh_E,5803
|
|
39
|
+
codemie_sdk/services/workflow_execution.py,sha256=BfbnoyMutQ4_SkpKdCi-F2A5r9JqEfq5yQMAS-1vyz4,5543
|
|
31
40
|
codemie_sdk/services/workflow_execution_state.py,sha256=tXoaa8yT09xgYEUNiHhVULe76TwGwVgZupMIUyyLxdo,2070
|
|
32
41
|
codemie_sdk/utils/__init__.py,sha256=BXAJJfAzO89-kMYvWWo9wSNhSbGgF3vB1In9sePFhMM,109
|
|
33
|
-
codemie_sdk/utils/http.py,sha256=
|
|
34
|
-
codemie_sdk_python-0.1.
|
|
35
|
-
codemie_sdk_python-0.1.
|
|
36
|
-
codemie_sdk_python-0.1.
|
|
42
|
+
codemie_sdk/utils/http.py,sha256=XGlNUXJ43Kg-Tj_uDg5Zh7oxrIPFZJm6cPOIrBxFL0k,10266
|
|
43
|
+
codemie_sdk_python-0.1.230.dist-info/METADATA,sha256=HxbMMsJVfqZ32YXaLiiY0pZynNheV42KH-XA1YggqoI,26967
|
|
44
|
+
codemie_sdk_python-0.1.230.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
45
|
+
codemie_sdk_python-0.1.230.dist-info/RECORD,,
|
|
File without changes
|