codemie-sdk-python 0.1.226__py3-none-any.whl → 0.1.256__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.
- codemie_sdk/__init__.py +27 -1
- codemie_sdk/client/client.py +14 -0
- codemie_sdk/models/assistant.py +53 -0
- codemie_sdk/models/datasource.py +45 -0
- codemie_sdk/models/integration.py +1 -1
- codemie_sdk/models/vendor_guardrail.py +152 -0
- codemie_sdk/models/workflow_execution_payload.py +4 -0
- codemie_sdk/services/assistant.py +214 -0
- codemie_sdk/services/datasource.py +67 -0
- codemie_sdk/services/files.py +21 -0
- codemie_sdk/services/vendor_guardrail.py +375 -0
- codemie_sdk/services/workflow.py +10 -1
- codemie_sdk/services/workflow_execution.py +26 -4
- codemie_sdk/utils/http.py +21 -7
- {codemie_sdk_python-0.1.226.dist-info → codemie_sdk_python-0.1.256.dist-info}/METADATA +129 -9
- {codemie_sdk_python-0.1.226.dist-info → codemie_sdk_python-0.1.256.dist-info}/RECORD +17 -15
- {codemie_sdk_python-0.1.226.dist-info → codemie_sdk_python-0.1.256.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.256
|
|
4
4
|
Summary: CodeMie SDK for Python
|
|
5
5
|
Author: Vadym Vlasenko
|
|
6
6
|
Author-email: vadym_vlasenko@epam.com
|
|
@@ -25,6 +25,7 @@ Python SDK for CodeMie services. This SDK provides a comprehensive interface to
|
|
|
25
25
|
- [Assistant Service](#assistant-service)
|
|
26
26
|
- [Core Methods](#core-methods)
|
|
27
27
|
- [Advanced Features](#advanced-features)
|
|
28
|
+
- [Prompt Variables Support](#prompt-variables-support)
|
|
28
29
|
- [Datasource Service](#datasource-service)
|
|
29
30
|
- [Supported Datasource Types](#supported-datasource-types)
|
|
30
31
|
- [Core Methods](#core-methods-1)
|
|
@@ -174,16 +175,41 @@ result = client.assistant.delete("assistant-id")
|
|
|
174
175
|
|
|
175
176
|
#### Advanced Features
|
|
176
177
|
|
|
177
|
-
6. **Chat with Assistant**
|
|
178
|
+
6. **Chat with Assistant (with MCP header propagation)**
|
|
178
179
|
```python
|
|
179
180
|
from codemie_sdk.models.assistant import AssistantChatRequest
|
|
180
181
|
|
|
181
182
|
chat_request = AssistantChatRequest(
|
|
182
183
|
text="Your message here",
|
|
183
184
|
stream=False, # Set to True for streaming response
|
|
184
|
-
#
|
|
185
|
+
propagate_headers=True, # Enable propagation of X-* headers to MCP servers
|
|
186
|
+
)
|
|
187
|
+
# Pass X-* headers to forward to MCP servers
|
|
188
|
+
response = client.assistant.chat(
|
|
189
|
+
"assistant-id",
|
|
190
|
+
chat_request,
|
|
191
|
+
headers={
|
|
192
|
+
"X-Tenant-ID": "tenant-abc-123",
|
|
193
|
+
"X-User-ID": "user-456",
|
|
194
|
+
"X-Request-ID": "req-123",
|
|
195
|
+
},
|
|
196
|
+
)
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
6.a. **Chat with Assistant by slug (with MCP header propagation)**
|
|
200
|
+
```python
|
|
201
|
+
chat_request = AssistantChatRequest(
|
|
202
|
+
text="Your message here",
|
|
203
|
+
propagate_headers=True,
|
|
204
|
+
)
|
|
205
|
+
response = client.assistants.chat_by_slug(
|
|
206
|
+
"assistant-slug",
|
|
207
|
+
chat_request,
|
|
208
|
+
headers={
|
|
209
|
+
"X-Environment": "production",
|
|
210
|
+
"X-Feature-Flag-Beta": "true",
|
|
211
|
+
},
|
|
185
212
|
)
|
|
186
|
-
response = client.assistant.chat("assistant-id", chat_request)
|
|
187
213
|
```
|
|
188
214
|
|
|
189
215
|
7. **Utilize structured outputs with Assistant**
|
|
@@ -243,6 +269,42 @@ prebuilt_assistant = client.assistant.get_prebuilt_by_slug("assistant-slug")
|
|
|
243
269
|
tools = client.assistant.get_tools()
|
|
244
270
|
```
|
|
245
271
|
|
|
272
|
+
### Prompt Variables Support
|
|
273
|
+
The SDK supports assistant-level prompt variables that the backend already exposes via the `prompt_variables` field.
|
|
274
|
+
|
|
275
|
+
Create and update an assistant with prompt variables:
|
|
276
|
+
```python
|
|
277
|
+
from codemie_sdk.models.assistant import AssistantCreateRequest, AssistantUpdateRequest, PromptVariable
|
|
278
|
+
|
|
279
|
+
# Create
|
|
280
|
+
create_req = AssistantCreateRequest(
|
|
281
|
+
name="My Assistant",
|
|
282
|
+
description="Assistant description",
|
|
283
|
+
system_prompt="Instructions. Use {{project_name}} in responses.",
|
|
284
|
+
toolkits=[],
|
|
285
|
+
project="my_project",
|
|
286
|
+
llm_model_type="gpt-4o",
|
|
287
|
+
context=[],
|
|
288
|
+
conversation_starters=[],
|
|
289
|
+
mcp_servers=[],
|
|
290
|
+
assistant_ids=[],
|
|
291
|
+
prompt_variables=[
|
|
292
|
+
PromptVariable(key="project_name", default_value="Delta", description="Current project"),
|
|
293
|
+
PromptVariable(key="region", default_value="eu"),
|
|
294
|
+
],
|
|
295
|
+
)
|
|
296
|
+
client.assistants.create(create_req)
|
|
297
|
+
|
|
298
|
+
# Update
|
|
299
|
+
update_req = AssistantUpdateRequest(
|
|
300
|
+
**create_req.model_dump(),
|
|
301
|
+
prompt_variables=[
|
|
302
|
+
PromptVariable(key="project_name", default_value="Delta-Updated"),
|
|
303
|
+
PromptVariable(key="region", default_value="us"),
|
|
304
|
+
],
|
|
305
|
+
)
|
|
306
|
+
client.assistants.update("assistant-id", update_req)
|
|
307
|
+
|
|
246
308
|
### Datasource Service
|
|
247
309
|
|
|
248
310
|
The Datasource service enables managing various types of data sources in CodeMie, including code repositories, Confluence spaces, Jira projects, files, and Google documents.
|
|
@@ -548,10 +610,18 @@ result = client.workflow.delete("workflow-id")
|
|
|
548
610
|
|
|
549
611
|
The SDK provides comprehensive workflow execution management through the WorkflowExecutionService:
|
|
550
612
|
|
|
551
|
-
1. **Run Workflow**
|
|
613
|
+
1. **Run Workflow (with MCP header propagation)**
|
|
552
614
|
```python
|
|
553
|
-
#
|
|
554
|
-
execution = client.workflow.run(
|
|
615
|
+
# Enable propagation in payload and pass X-* headers to forward to MCP servers
|
|
616
|
+
execution = client.workflow.run(
|
|
617
|
+
"workflow-id",
|
|
618
|
+
user_input="optional input",
|
|
619
|
+
propagate_headers=True,
|
|
620
|
+
headers={
|
|
621
|
+
"X-Request-ID": "req-abc-123",
|
|
622
|
+
"X-Source-App": "analytics-ui",
|
|
623
|
+
},
|
|
624
|
+
)
|
|
555
625
|
|
|
556
626
|
# Get execution service for advanced operations
|
|
557
627
|
execution_service = client.workflow.executions("workflow-id")
|
|
@@ -571,8 +641,14 @@ execution = execution_service.get("execution-id")
|
|
|
571
641
|
# Abort running execution
|
|
572
642
|
result = execution_service.abort("execution-id")
|
|
573
643
|
|
|
574
|
-
# Resume interrupted execution
|
|
575
|
-
result = execution_service.resume(
|
|
644
|
+
# Resume interrupted execution with header propagation (query param + headers)
|
|
645
|
+
result = execution_service.resume(
|
|
646
|
+
"execution-id",
|
|
647
|
+
propagate_headers=True,
|
|
648
|
+
headers={
|
|
649
|
+
"X-Correlation-ID": "corr-456",
|
|
650
|
+
},
|
|
651
|
+
)
|
|
576
652
|
|
|
577
653
|
# Delete all executions
|
|
578
654
|
result = execution_service.delete_all()
|
|
@@ -831,6 +907,50 @@ client = CodeMieClient(
|
|
|
831
907
|
)
|
|
832
908
|
```
|
|
833
909
|
|
|
910
|
+
### Assistant Versioning via SDK
|
|
911
|
+
|
|
912
|
+
The Python SDK exposes full assistant versioning capabilities delivered in EPMCDME-8285.
|
|
913
|
+
|
|
914
|
+
- List versions
|
|
915
|
+
```python
|
|
916
|
+
versions = client.assistants.list_versions("assistant-id", page=0, per_page=20)
|
|
917
|
+
print([v.version_number for v in versions])
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
- Get specific version
|
|
921
|
+
```python
|
|
922
|
+
version = client.assistants.get_version("assistant-id", 2)
|
|
923
|
+
print(version.system_prompt)
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
- Compare two versions
|
|
927
|
+
```python
|
|
928
|
+
from codemie_sdk.models.assistant import AssistantVersionDiff
|
|
929
|
+
|
|
930
|
+
diff: AssistantVersionDiff = client.assistants.compare_versions("assistant-id", 1, 3)
|
|
931
|
+
print(diff.summary)
|
|
932
|
+
```
|
|
933
|
+
|
|
934
|
+
- Rollback to a version
|
|
935
|
+
```python
|
|
936
|
+
resp = client.assistants.rollback_to_version("assistant-id", 2)
|
|
937
|
+
print(resp)
|
|
938
|
+
```
|
|
939
|
+
|
|
940
|
+
- Chat with a specific version
|
|
941
|
+
```python
|
|
942
|
+
from codemie_sdk.models.assistant import AssistantChatRequest
|
|
943
|
+
|
|
944
|
+
req = AssistantChatRequest(text="Hi", stream=False)
|
|
945
|
+
resp = client.assistants.chat_with_version("assistant-id", 2, req)
|
|
946
|
+
print(resp.generated)
|
|
947
|
+
```
|
|
948
|
+
|
|
949
|
+
Quick CLI example
|
|
950
|
+
```bash
|
|
951
|
+
python codemie-sdk/examples/assistant_versions.py <assistant_id> [version_number]
|
|
952
|
+
```
|
|
953
|
+
|
|
834
954
|
## Support
|
|
835
955
|
For providing credentials please contact AI/Run CodeMie Team: Vadym_Vlasenko@epam.com or Nikita_Levyankov@epam.com
|
|
836
956
|
|
|
@@ -1,43 +1,45 @@
|
|
|
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=sz6h62XE1g2tTbgNdbeMws-wQPROXwLTUmtaVI6TC1U,7155
|
|
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=Mi96oQky7s61ICCr8WuvTocNE8pLUXLdjNjSVNpfewE,12692
|
|
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=oVbHEPvwedKVEhi-_hVIMGmIKg7t1ZIqYltgMoqctdQ,12801
|
|
12
12
|
codemie_sdk/models/file_operation.py,sha256=D2hnsxOO9lzVMw0BNCgKPfHf28bWQmbw5rccgaTXI90,747
|
|
13
|
-
codemie_sdk/models/integration.py,sha256=
|
|
13
|
+
codemie_sdk/models/integration.py,sha256=FFFcggLf9kh5QVle1T8Jexyh5bc3hgh39YHIp8xfMZ0,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
17
|
codemie_sdk/models/vendor_assistant.py,sha256=4xPBwE-x2eWNNHAVsdOrZSDKvvp4UqlsunR0Q9pQccc,6409
|
|
18
|
+
codemie_sdk/models/vendor_guardrail.py,sha256=ThttN224rvievqUxTmFTKjIxose-VW_mYopwF-WOzd4,5279
|
|
18
19
|
codemie_sdk/models/vendor_knowledgebase.py,sha256=uRfKRaOPh71IMSJMFB-9Kki01TVtGbEjF_wupTvDG58,5051
|
|
19
20
|
codemie_sdk/models/vendor_workflow.py,sha256=EbBwpj4lDLsYawrflomDW0KcHUXN-34FKPqQBVQYJ4I,4975
|
|
20
21
|
codemie_sdk/models/workflow.py,sha256=qfk0rBJnFUMpcEDq_E5GB3hzYKbe_bb2NYJlLZJwUEE,2453
|
|
21
|
-
codemie_sdk/models/workflow_execution_payload.py,sha256=
|
|
22
|
+
codemie_sdk/models/workflow_execution_payload.py,sha256=Pa28ElqsJLudscJnmZhXUEJWJXLw55xc-KYBPi97EZ4,724
|
|
22
23
|
codemie_sdk/models/workflow_state.py,sha256=okEMKzkiBU3GHs9VNBoiEMOnOeZRMXGYtpL0NYSg-FY,1374
|
|
23
24
|
codemie_sdk/models/workflow_thoughts.py,sha256=CjHaIPgca9kQAjpoq8IpX4MuDeql1SvaoKS5RmyU2SE,616
|
|
24
|
-
codemie_sdk/services/assistant.py,sha256=
|
|
25
|
+
codemie_sdk/services/assistant.py,sha256=hbKW2gweGMcOQCXbhrkgI__gwuPgZk0jz1GzJ7kH8Dw,15940
|
|
25
26
|
codemie_sdk/services/conversation.py,sha256=Ss0mkGaBi4u8-YKzhRYUJOfoFqJueDp9JurI5DRCGT8,2566
|
|
26
|
-
codemie_sdk/services/datasource.py,sha256=
|
|
27
|
-
codemie_sdk/services/files.py,sha256=
|
|
27
|
+
codemie_sdk/services/datasource.py,sha256=vusKiIyRZwliBUPzp78saXuiIEAg1f4FLz-g5ildRFY,9773
|
|
28
|
+
codemie_sdk/services/files.py,sha256=SgqPmI1jnWIQ7pdxZSaRDnCFU7OnJllb5XLH-1q3zNg,2512
|
|
28
29
|
codemie_sdk/services/integration.py,sha256=SdwFwR3hCPyJYilzzlkpKPLNbO89nfqmIXXoT7bDEBI,5410
|
|
29
30
|
codemie_sdk/services/llm.py,sha256=0-e4_7RvLHs2giCyoQ5U4KDTh6p5VXgPKNxnDP9ZDFU,1100
|
|
30
31
|
codemie_sdk/services/task.py,sha256=3e9t8_LMkR4xfeMBwMCo7ZF87PxPS-ZbzDg85ilda2M,1031
|
|
31
32
|
codemie_sdk/services/user.py,sha256=7B-Qw451qKPD5Io6qLda-kbFDaPRQ3TamJamiGwCQu4,1013
|
|
32
33
|
codemie_sdk/services/vendor_assistant.py,sha256=QP8Qgo1rb0ak199mACFmNN2qrnYMAefs3VIBB5uHJxg,13485
|
|
34
|
+
codemie_sdk/services/vendor_guardrail.py,sha256=ZQGgBfe-pN9cBIt-e3ud99UF7iChtwZuJRJv-3W_Eew,14281
|
|
33
35
|
codemie_sdk/services/vendor_knowledgebase.py,sha256=wHLUexRwX-5V-GZcfdoMwjMiCPE4gD5w6D8A1YvB21E,10413
|
|
34
36
|
codemie_sdk/services/vendor_workflow.py,sha256=h-UlEnYjV8d0EoEPb9BgMdxPBJvtY0KUZXLQfqYeqX4,12453
|
|
35
37
|
codemie_sdk/services/webhook.py,sha256=QhRKo7y9BcboYJm_cPdPqYDhmv_OWTf9eodsT3UkAjM,1210
|
|
36
|
-
codemie_sdk/services/workflow.py,sha256=
|
|
37
|
-
codemie_sdk/services/workflow_execution.py,sha256=
|
|
38
|
+
codemie_sdk/services/workflow.py,sha256=3YQjjf8YhZZKt-Oyt3DViDChRXWqHSGwDETO3XYnh_E,5803
|
|
39
|
+
codemie_sdk/services/workflow_execution.py,sha256=BfbnoyMutQ4_SkpKdCi-F2A5r9JqEfq5yQMAS-1vyz4,5543
|
|
38
40
|
codemie_sdk/services/workflow_execution_state.py,sha256=tXoaa8yT09xgYEUNiHhVULe76TwGwVgZupMIUyyLxdo,2070
|
|
39
41
|
codemie_sdk/utils/__init__.py,sha256=BXAJJfAzO89-kMYvWWo9wSNhSbGgF3vB1In9sePFhMM,109
|
|
40
|
-
codemie_sdk/utils/http.py,sha256=
|
|
41
|
-
codemie_sdk_python-0.1.
|
|
42
|
-
codemie_sdk_python-0.1.
|
|
43
|
-
codemie_sdk_python-0.1.
|
|
42
|
+
codemie_sdk/utils/http.py,sha256=pVNYH1PTqfu8ZzP3tBCugVUOroh_QcKu2ej8EzeDm4Q,10337
|
|
43
|
+
codemie_sdk_python-0.1.256.dist-info/METADATA,sha256=AtFQeAbvfZ8oyU9ACQ_ruwOW-lcivm2BMTRXZQp9ld8,28207
|
|
44
|
+
codemie_sdk_python-0.1.256.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
45
|
+
codemie_sdk_python-0.1.256.dist-info/RECORD,,
|
|
File without changes
|