codemie-sdk-python 0.1.249__tar.gz → 0.1.258__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.
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/PKG-INFO +556 -211
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/README.md +556 -211
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/pyproject.toml +1 -1
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/datasource.py +35 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/__init__.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/auth/__init__.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/auth/credentials.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/client/__init__.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/client/client.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/exceptions.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/__init__.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/assistant.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/common.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/conversation.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/file_operation.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/integration.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/llm.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/task.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/user.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/vendor_assistant.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/vendor_guardrail.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/vendor_knowledgebase.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/vendor_workflow.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/workflow.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/workflow_execution_payload.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/workflow_state.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/models/workflow_thoughts.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/assistant.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/conversation.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/datasource.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/files.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/integration.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/llm.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/task.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/user.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/vendor_assistant.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/vendor_guardrail.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/vendor_knowledgebase.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/vendor_workflow.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/webhook.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/workflow.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/workflow_execution.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/services/workflow_execution_state.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/src/codemie_sdk/utils/__init__.py +0 -0
- {codemie_sdk_python-0.1.249 → codemie_sdk_python-0.1.258}/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.
|
|
3
|
+
Version: 0.1.258
|
|
4
4
|
Summary: CodeMie SDK for Python
|
|
5
5
|
Author: Vadym Vlasenko
|
|
6
6
|
Author-email: vadym_vlasenko@epam.com
|
|
@@ -26,6 +26,7 @@ Python SDK for CodeMie services. This SDK provides a comprehensive interface to
|
|
|
26
26
|
- [Core Methods](#core-methods)
|
|
27
27
|
- [Advanced Features](#advanced-features)
|
|
28
28
|
- [Prompt Variables Support](#prompt-variables-support)
|
|
29
|
+
- [Assistant Versioning](#assistant-versioning)
|
|
29
30
|
- [Datasource Service](#datasource-service)
|
|
30
31
|
- [Supported Datasource Types](#supported-datasource-types)
|
|
31
32
|
- [Core Methods](#core-methods-1)
|
|
@@ -44,30 +45,35 @@ Python SDK for CodeMie services. This SDK provides a comprehensive interface to
|
|
|
44
45
|
- [Workflow Status Monitoring](#workflow-status-monitoring)
|
|
45
46
|
- [Conversation Service](#conversation-service)
|
|
46
47
|
- [Core Methods](#core-methods-4)
|
|
47
|
-
- [
|
|
48
|
+
- [File Service](#file-service)
|
|
48
49
|
- [Core Methods](#core-methods-5)
|
|
49
|
-
- [
|
|
50
|
-
|
|
51
|
-
- [
|
|
52
|
-
|
|
50
|
+
- [User Service](#user-service)
|
|
51
|
+
- [Core Methods](#core-methods-6)
|
|
52
|
+
- [Task Service](#task-service)
|
|
53
|
+
- [Core Methods](#core-methods-7)
|
|
54
|
+
- [Webhook Service](#webhook-service)
|
|
55
|
+
- [Core Methods](#core-methods-8)
|
|
56
|
+
- [Vendor Services](#vendor-services)
|
|
57
|
+
- [Vendor Assistant Service](#vendor-assistant-service)
|
|
58
|
+
- [Vendor Workflow Service](#vendor-workflow-service)
|
|
59
|
+
- [Vendor Knowledge Base Service](#vendor-knowledge-base-service)
|
|
60
|
+
- [Vendor Guardrail Service](#vendor-guardrail-service)
|
|
53
61
|
- [Error Handling](#error-handling-1)
|
|
54
62
|
- [Authentication](#authentication)
|
|
55
63
|
- [Required Parameters](#required-parameters)
|
|
56
64
|
- [Usage Examples](#usage-examples)
|
|
57
65
|
- [Best Practices](#best-practices-1)
|
|
58
66
|
- [Support](#support)
|
|
67
|
+
- [Development](#development)
|
|
68
|
+
- [Setup](#setup)
|
|
69
|
+
- [Code Quality](#code-quality)
|
|
70
|
+
- [Building Package](#building-package)
|
|
59
71
|
|
|
60
72
|
## Installation
|
|
61
73
|
|
|
62
74
|
```sh
|
|
63
75
|
pip install codemie-sdk-python
|
|
64
76
|
```
|
|
65
|
-
OR
|
|
66
|
-
```sh
|
|
67
|
-
poetry install
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### If you want to run only tests, go to ## Running tests section
|
|
71
77
|
|
|
72
78
|
## Usage
|
|
73
79
|
|
|
@@ -90,30 +96,25 @@ client = CodeMieClient(
|
|
|
90
96
|
|
|
91
97
|
### LLM Service
|
|
92
98
|
|
|
93
|
-
The LLM service provides access to language models and embedding models
|
|
99
|
+
The LLM service provides access to language models and embedding models.
|
|
94
100
|
|
|
95
|
-
|
|
96
|
-
```python
|
|
97
|
-
llm_models = client.llm.list(token=client.token)
|
|
98
|
-
```
|
|
101
|
+
**Available Methods:**
|
|
99
102
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
embedding_models = client.llm.list_embeddings(token=client.token)
|
|
103
|
-
```
|
|
103
|
+
1. **list()** - Retrieves a list of available LLM models
|
|
104
|
+
2. **list_embeddings()** - Retrieves a list of available embedding models
|
|
104
105
|
|
|
105
|
-
Each LLM model contains
|
|
106
|
+
Each LLM model contains:
|
|
106
107
|
- Model identifier
|
|
107
108
|
- Model capabilities
|
|
108
109
|
- Configuration parameters
|
|
109
110
|
|
|
110
|
-
Example
|
|
111
|
+
**Example:**
|
|
111
112
|
```python
|
|
112
113
|
# List available LLM models
|
|
113
|
-
llm_models = client.
|
|
114
|
+
llm_models = client.llms.list()
|
|
114
115
|
|
|
115
116
|
# List available embedding models
|
|
116
|
-
embedding_models = client.
|
|
117
|
+
embedding_models = client.llms.list_embeddings()
|
|
117
118
|
```
|
|
118
119
|
|
|
119
120
|
### Assistant Service
|
|
@@ -124,7 +125,7 @@ The Assistant service allows you to manage and interact with CodeMie assistants:
|
|
|
124
125
|
|
|
125
126
|
1. **List Assistants**
|
|
126
127
|
```python
|
|
127
|
-
assistants = client.
|
|
128
|
+
assistants = client.assistants.list(
|
|
128
129
|
minimal_response=True, # Return minimal assistant info
|
|
129
130
|
scope="visible_to_user", # or "created_by_user"
|
|
130
131
|
page=0,
|
|
@@ -136,10 +137,10 @@ assistants = client.assistant.list(
|
|
|
136
137
|
2. **Get Assistant Details**
|
|
137
138
|
```python
|
|
138
139
|
# By ID
|
|
139
|
-
assistant = client.
|
|
140
|
+
assistant = client.assistants.get("assistant-id")
|
|
140
141
|
|
|
141
142
|
# By Slug
|
|
142
|
-
assistant = client.
|
|
143
|
+
assistant = client.assistants.get_by_slug("assistant-slug")
|
|
143
144
|
```
|
|
144
145
|
|
|
145
146
|
3. **Create Assistant**
|
|
@@ -153,7 +154,7 @@ request = AssistantCreateRequest(
|
|
|
153
154
|
tools=["tool1", "tool2"],
|
|
154
155
|
# Additional parameters as needed
|
|
155
156
|
)
|
|
156
|
-
new_assistant = client.
|
|
157
|
+
new_assistant = client.assistants.create(request)
|
|
157
158
|
```
|
|
158
159
|
|
|
159
160
|
4. **Update Assistant**
|
|
@@ -165,12 +166,12 @@ request = AssistantUpdateRequest(
|
|
|
165
166
|
description="Updated description",
|
|
166
167
|
# Other fields to update
|
|
167
168
|
)
|
|
168
|
-
updated_assistant = client.
|
|
169
|
+
updated_assistant = client.assistants.update("assistant-id", request)
|
|
169
170
|
```
|
|
170
171
|
|
|
171
172
|
5. **Delete Assistant**
|
|
172
173
|
```python
|
|
173
|
-
result = client.
|
|
174
|
+
result = client.assistants.delete("assistant-id")
|
|
174
175
|
```
|
|
175
176
|
|
|
176
177
|
#### Advanced Features
|
|
@@ -185,7 +186,7 @@ chat_request = AssistantChatRequest(
|
|
|
185
186
|
propagate_headers=True, # Enable propagation of X-* headers to MCP servers
|
|
186
187
|
)
|
|
187
188
|
# Pass X-* headers to forward to MCP servers
|
|
188
|
-
response = client.
|
|
189
|
+
response = client.assistants.chat(
|
|
189
190
|
"assistant-id",
|
|
190
191
|
chat_request,
|
|
191
192
|
headers={
|
|
@@ -196,7 +197,7 @@ response = client.assistant.chat(
|
|
|
196
197
|
)
|
|
197
198
|
```
|
|
198
199
|
|
|
199
|
-
|
|
200
|
+
7. **Chat with Assistant by slug (with MCP header propagation)**
|
|
200
201
|
```python
|
|
201
202
|
chat_request = AssistantChatRequest(
|
|
202
203
|
text="Your message here",
|
|
@@ -212,7 +213,7 @@ response = client.assistants.chat_by_slug(
|
|
|
212
213
|
)
|
|
213
214
|
```
|
|
214
215
|
|
|
215
|
-
|
|
216
|
+
8. **Utilize structured outputs with Assistant**
|
|
216
217
|
```python
|
|
217
218
|
from pydantic import BaseModel
|
|
218
219
|
|
|
@@ -221,8 +222,8 @@ class OutputSchema(BaseModel):
|
|
|
221
222
|
|
|
222
223
|
chat_request = AssistantChatRequest(
|
|
223
224
|
text="Your message here",
|
|
224
|
-
stream=False,
|
|
225
|
-
output_schema=OutputSchema
|
|
225
|
+
stream=False,
|
|
226
|
+
output_schema=OutputSchema,
|
|
226
227
|
# Additional parameters
|
|
227
228
|
)
|
|
228
229
|
|
|
@@ -246,30 +247,31 @@ output_schema = {
|
|
|
246
247
|
|
|
247
248
|
chat_request = AssistantChatRequest(
|
|
248
249
|
text="Your message here",
|
|
249
|
-
stream=False,
|
|
250
|
-
output_schema=output_schema
|
|
250
|
+
stream=False,
|
|
251
|
+
output_schema=output_schema,
|
|
251
252
|
# Additional parameters
|
|
252
253
|
)
|
|
253
254
|
|
|
254
255
|
response = client.assistants.chat("id", chat_request)
|
|
255
|
-
# response.generated is a dict
|
|
256
|
+
# response.generated is a dict corresponding to the JSON schema
|
|
256
257
|
```
|
|
257
258
|
|
|
258
|
-
|
|
259
|
+
9. **Work with Prebuilt Assistants**
|
|
259
260
|
```python
|
|
260
261
|
# List prebuilt assistants
|
|
261
|
-
prebuilt = client.
|
|
262
|
+
prebuilt = client.assistants.get_prebuilt()
|
|
262
263
|
|
|
263
264
|
# Get specific prebuilt assistant
|
|
264
|
-
prebuilt_assistant = client.
|
|
265
|
+
prebuilt_assistant = client.assistants.get_prebuilt_by_slug("assistant-slug")
|
|
265
266
|
```
|
|
266
267
|
|
|
267
|
-
|
|
268
|
+
10. **Get Available Tools**
|
|
268
269
|
```python
|
|
269
|
-
tools = client.
|
|
270
|
+
tools = client.assistants.get_tools()
|
|
270
271
|
```
|
|
271
272
|
|
|
272
|
-
|
|
273
|
+
#### Prompt Variables Support
|
|
274
|
+
|
|
273
275
|
The SDK supports assistant-level prompt variables that the backend already exposes via the `prompt_variables` field.
|
|
274
276
|
|
|
275
277
|
Create and update an assistant with prompt variables:
|
|
@@ -304,6 +306,52 @@ update_req = AssistantUpdateRequest(
|
|
|
304
306
|
],
|
|
305
307
|
)
|
|
306
308
|
client.assistants.update("assistant-id", update_req)
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
#### Assistant Versioning
|
|
312
|
+
|
|
313
|
+
The SDK provides full assistant versioning capabilities.
|
|
314
|
+
|
|
315
|
+
1. **List Versions**
|
|
316
|
+
```python
|
|
317
|
+
# Get all versions of an assistant
|
|
318
|
+
versions = client.assistants.list_versions("assistant-id", page=0, per_page=20)
|
|
319
|
+
for version in versions:
|
|
320
|
+
print(f"Version {version.version_number}")
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
2. **Get Specific Version**
|
|
324
|
+
```python
|
|
325
|
+
# Get details of a specific version
|
|
326
|
+
version = client.assistants.get_version("assistant-id", version_number=2)
|
|
327
|
+
print(version.system_prompt)
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
3. **Compare Versions**
|
|
331
|
+
```python
|
|
332
|
+
from codemie_sdk.models.assistant import AssistantVersionDiff
|
|
333
|
+
|
|
334
|
+
# Compare two versions to see what changed
|
|
335
|
+
diff = client.assistants.compare_versions("assistant-id", version1=1, version2=3)
|
|
336
|
+
print(diff.summary)
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
4. **Rollback to Version**
|
|
340
|
+
```python
|
|
341
|
+
# Rollback assistant to a previous version
|
|
342
|
+
response = client.assistants.rollback_to_version("assistant-id", version_number=2)
|
|
343
|
+
print(f"Rolled back to version {response.version_number}")
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
5. **Chat with Specific Version**
|
|
347
|
+
```python
|
|
348
|
+
from codemie_sdk.models.assistant import AssistantChatRequest
|
|
349
|
+
|
|
350
|
+
# Chat with a specific version of the assistant
|
|
351
|
+
request = AssistantChatRequest(text="Hi", stream=False)
|
|
352
|
+
response = client.assistants.chat_with_version("assistant-id", version_number=2, request)
|
|
353
|
+
print(response.generated)
|
|
354
|
+
```
|
|
307
355
|
|
|
308
356
|
### Datasource Service
|
|
309
357
|
|
|
@@ -316,6 +364,7 @@ The Datasource service enables managing various types of data sources in CodeMie
|
|
|
316
364
|
- `JIRA`: Jira knowledge base
|
|
317
365
|
- `FILE`: File-based knowledge base
|
|
318
366
|
- `GOOGLE`: Google documents
|
|
367
|
+
- `AZURE_DEVOPS_WIKI`: Azure DevOps Wiki knowledge base (requires Azure DevOps integration)
|
|
319
368
|
|
|
320
369
|
#### Core Methods
|
|
321
370
|
|
|
@@ -325,7 +374,8 @@ from codemie_sdk.models.datasource import (
|
|
|
325
374
|
CodeDataSourceRequest,
|
|
326
375
|
ConfluenceDataSourceRequest,
|
|
327
376
|
JiraDataSourceRequest,
|
|
328
|
-
GoogleDataSourceRequest
|
|
377
|
+
GoogleDataSourceRequest,
|
|
378
|
+
AzureDevOpsWikiDataSourceRequest
|
|
329
379
|
)
|
|
330
380
|
|
|
331
381
|
# Create Code Datasource
|
|
@@ -341,7 +391,7 @@ code_request = CodeDataSourceRequest(
|
|
|
341
391
|
summarization_model="gpt-4", # optional
|
|
342
392
|
docs_generation=False # optional
|
|
343
393
|
)
|
|
344
|
-
result = client.
|
|
394
|
+
result = client.datasources.create(code_request)
|
|
345
395
|
|
|
346
396
|
# Create Confluence Datasource
|
|
347
397
|
confluence_request = ConfluenceDataSourceRequest(
|
|
@@ -354,7 +404,7 @@ confluence_request = ConfluenceDataSourceRequest(
|
|
|
354
404
|
include_attachments=True,
|
|
355
405
|
include_comments=True
|
|
356
406
|
)
|
|
357
|
-
result = client.
|
|
407
|
+
result = client.datasources.create(confluence_request)
|
|
358
408
|
|
|
359
409
|
# Create Jira Datasource
|
|
360
410
|
jira_request = JiraDataSourceRequest(
|
|
@@ -363,7 +413,7 @@ jira_request = JiraDataSourceRequest(
|
|
|
363
413
|
description="Jira project",
|
|
364
414
|
jql="project = 'MYPROJECT'"
|
|
365
415
|
)
|
|
366
|
-
result = client.
|
|
416
|
+
result = client.datasources.create(jira_request)
|
|
367
417
|
|
|
368
418
|
# Create Google Doc Datasource
|
|
369
419
|
google_request = GoogleDataSourceRequest(
|
|
@@ -372,12 +422,39 @@ google_request = GoogleDataSourceRequest(
|
|
|
372
422
|
description="Google document",
|
|
373
423
|
google_doc="document_url"
|
|
374
424
|
)
|
|
375
|
-
result = client.
|
|
425
|
+
result = client.datasources.create(google_request)
|
|
426
|
+
|
|
427
|
+
# Create Azure DevOps Wiki Datasource
|
|
428
|
+
# Note: Requires Azure DevOps integration to be configured
|
|
429
|
+
ado_wiki_request = AzureDevOpsWikiDataSourceRequest(
|
|
430
|
+
name="ado_wiki",
|
|
431
|
+
project_name="my_project",
|
|
432
|
+
description="Azure DevOps Wiki",
|
|
433
|
+
setting_id="azure-devops-integration-id", # Integration ID with ADO credentials
|
|
434
|
+
wiki_query="*", # Path filter (see wiki_query format below)
|
|
435
|
+
wiki_name="MyProject.wiki" # Optional: specific wiki name (leave empty for all wikis)
|
|
436
|
+
)
|
|
437
|
+
result = client.datasources.create(ado_wiki_request)
|
|
438
|
+
|
|
439
|
+
# Important: wiki_query Path Format
|
|
440
|
+
# The page path should NOT include "/Overview/Wiki" and must start from the page level.
|
|
441
|
+
#
|
|
442
|
+
# Example: If your Azure DevOps breadcrumbs show:
|
|
443
|
+
# "ProjectName/WikiName/Overview/Wiki/Page1/Page2"
|
|
444
|
+
#
|
|
445
|
+
# Then use: "/Page1/*" as the path
|
|
446
|
+
#
|
|
447
|
+
# Build the path using breadcrumb values, NOT the page URL.
|
|
448
|
+
#
|
|
449
|
+
# Common patterns:
|
|
450
|
+
# - "*" - Index all pages in the wiki
|
|
451
|
+
# - "/Engineering/*" - Index all pages under /Engineering folder
|
|
452
|
+
# - "/Engineering/Architecture" - Index only the Architecture page
|
|
376
453
|
```
|
|
377
454
|
|
|
378
455
|
2. **Update Datasource**
|
|
379
456
|
```python
|
|
380
|
-
from codemie_sdk.models.datasource import UpdateCodeDataSourceRequest
|
|
457
|
+
from codemie_sdk.models.datasource import UpdateCodeDataSourceRequest, UpdateAzureDevOpsWikiDataSourceRequest
|
|
381
458
|
|
|
382
459
|
# Update Code Datasource
|
|
383
460
|
update_request = UpdateCodeDataSourceRequest(
|
|
@@ -389,18 +466,36 @@ update_request = UpdateCodeDataSourceRequest(
|
|
|
389
466
|
skip_reindex=False,
|
|
390
467
|
resume_indexing=False
|
|
391
468
|
)
|
|
392
|
-
result = client.
|
|
469
|
+
result = client.datasources.update("datasource_id", update_request)
|
|
470
|
+
|
|
471
|
+
# Update Azure DevOps Wiki Datasource
|
|
472
|
+
ado_update_request = UpdateAzureDevOpsWikiDataSourceRequest(
|
|
473
|
+
name="ado_wiki",
|
|
474
|
+
project_name="my_project",
|
|
475
|
+
description="Updated description",
|
|
476
|
+
wiki_query="/Engineering/*", # Update path filter (see wiki_query format above)
|
|
477
|
+
wiki_name="MyProject.wiki",
|
|
478
|
+
full_reindex=True # Trigger full reindex
|
|
479
|
+
)
|
|
480
|
+
result = client.datasources.update("datasource_id", ado_update_request)
|
|
393
481
|
```
|
|
394
482
|
|
|
483
|
+
**Reindex Options for Azure DevOps Wiki:**
|
|
484
|
+
Azure DevOps Wiki datasources support the following reindex options:
|
|
485
|
+
- `full_reindex=True` - Completely reindex all pages (clears existing data and reindexes)
|
|
486
|
+
- `skip_reindex=True` - Update metadata without reindexing content
|
|
487
|
+
|
|
488
|
+
Note: Azure DevOps Wiki does not support `incremental_reindex` or `resume_indexing` options.
|
|
489
|
+
|
|
395
490
|
3. **List Datasources**
|
|
396
491
|
```python
|
|
397
492
|
# List all datasources with filtering and pagination
|
|
398
|
-
datasources = client.
|
|
493
|
+
datasources = client.datasources.list(
|
|
399
494
|
page=0,
|
|
400
495
|
per_page=10,
|
|
401
496
|
sort_key="update_date", # or "date"
|
|
402
497
|
sort_order="desc", # or "asc"
|
|
403
|
-
datasource_types=["CODE", "CONFLUENCE"], # optional filter by type
|
|
498
|
+
datasource_types=["CODE", "CONFLUENCE", "AZURE_DEVOPS_WIKI"], # optional filter by type
|
|
404
499
|
projects=["project1", "project2"], # optional filter by projects
|
|
405
500
|
owner="John Doe", # optional filter by owner
|
|
406
501
|
status="COMPLETED" # optional filter by status
|
|
@@ -410,13 +505,20 @@ datasources = client.datasource.list(
|
|
|
410
505
|
4. **Get Datasource Details**
|
|
411
506
|
```python
|
|
412
507
|
# Get single datasource by ID
|
|
413
|
-
datasource = client.
|
|
508
|
+
datasource = client.datasources.get("datasource_id")
|
|
509
|
+
|
|
510
|
+
# Access Azure DevOps Wiki specific fields
|
|
511
|
+
if datasource.type == "knowledge_base_azure_devops_wiki":
|
|
512
|
+
wiki_info = datasource.azure_devops_wiki
|
|
513
|
+
if wiki_info:
|
|
514
|
+
print(f"Wiki Query: {wiki_info.wiki_query}")
|
|
515
|
+
print(f"Wiki Name: {wiki_info.wiki_name}")
|
|
414
516
|
```
|
|
415
517
|
|
|
416
518
|
5. **Delete Datasource**
|
|
417
519
|
```python
|
|
418
520
|
# Delete datasource by ID
|
|
419
|
-
result = client.
|
|
521
|
+
result = client.datasources.delete("datasource_id")
|
|
420
522
|
```
|
|
421
523
|
|
|
422
524
|
#### Datasource Status
|
|
@@ -464,7 +566,7 @@ The Integration service manages both user and project-level integrations in Code
|
|
|
464
566
|
from codemie_sdk.models.integration import IntegrationType
|
|
465
567
|
|
|
466
568
|
# List user integrations with pagination
|
|
467
|
-
user_integrations = client.
|
|
569
|
+
user_integrations = client.integrations.list(
|
|
468
570
|
setting_type=IntegrationType.USER,
|
|
469
571
|
page=0,
|
|
470
572
|
per_page=10,
|
|
@@ -472,7 +574,7 @@ user_integrations = client.integration.list(
|
|
|
472
574
|
)
|
|
473
575
|
|
|
474
576
|
# List project integrations
|
|
475
|
-
project_integrations = client.
|
|
577
|
+
project_integrations = client.integrations.list(
|
|
476
578
|
setting_type=IntegrationType.PROJECT,
|
|
477
579
|
per_page=100
|
|
478
580
|
)
|
|
@@ -481,13 +583,13 @@ project_integrations = client.integration.list(
|
|
|
481
583
|
2. **Get Integration**
|
|
482
584
|
```python
|
|
483
585
|
# Get integration by ID
|
|
484
|
-
integration = client.
|
|
586
|
+
integration = client.integrations.get(
|
|
485
587
|
integration_id="integration_id",
|
|
486
588
|
setting_type=IntegrationType.USER
|
|
487
589
|
)
|
|
488
590
|
|
|
489
591
|
# Get integration by alias
|
|
490
|
-
integration = client.
|
|
592
|
+
integration = client.integrations.get_by_alias(
|
|
491
593
|
alias="integration_alias",
|
|
492
594
|
setting_type=IntegrationType.PROJECT
|
|
493
595
|
)
|
|
@@ -503,7 +605,7 @@ new_integration = Integration(
|
|
|
503
605
|
alias="my_integration",
|
|
504
606
|
# Add other required fields based on integration type
|
|
505
607
|
)
|
|
506
|
-
result = client.
|
|
608
|
+
result = client.integrations.create(new_integration)
|
|
507
609
|
```
|
|
508
610
|
|
|
509
611
|
4. **Update Integration**
|
|
@@ -514,13 +616,13 @@ updated_integration = Integration(
|
|
|
514
616
|
alias="updated_alias",
|
|
515
617
|
# Add other fields to update
|
|
516
618
|
)
|
|
517
|
-
result = client.
|
|
619
|
+
result = client.integrations.update("integration_id", updated_integration)
|
|
518
620
|
```
|
|
519
621
|
|
|
520
622
|
5. **Delete Integration**
|
|
521
623
|
```python
|
|
522
624
|
# Delete integration
|
|
523
|
-
result = client.
|
|
625
|
+
result = client.integrations.delete(
|
|
524
626
|
setting_id="integration_id",
|
|
525
627
|
setting_type=IntegrationType.USER
|
|
526
628
|
)
|
|
@@ -564,7 +666,7 @@ workflow_request = WorkflowCreateRequest(
|
|
|
564
666
|
shared=False, # Optional, defaults to False
|
|
565
667
|
icon_url="https://example.com/icon.png" # Optional
|
|
566
668
|
)
|
|
567
|
-
result = client.
|
|
669
|
+
result = client.workflows.create_workflow(workflow_request)
|
|
568
670
|
```
|
|
569
671
|
|
|
570
672
|
2. **Update Workflow**
|
|
@@ -579,13 +681,13 @@ update_request = WorkflowUpdateRequest(
|
|
|
579
681
|
mode="PARALLEL",
|
|
580
682
|
shared=True
|
|
581
683
|
)
|
|
582
|
-
result = client.
|
|
684
|
+
result = client.workflows.update("workflow-id", update_request)
|
|
583
685
|
```
|
|
584
686
|
|
|
585
687
|
3. **List Workflows**
|
|
586
688
|
```python
|
|
587
689
|
# List workflows with pagination and filtering
|
|
588
|
-
workflows = client.
|
|
690
|
+
workflows = client.workflows.list(
|
|
589
691
|
page=0,
|
|
590
692
|
per_page=10,
|
|
591
693
|
projects=["project1", "project2"] # Optional project filter
|
|
@@ -595,15 +697,15 @@ workflows = client.workflow.list(
|
|
|
595
697
|
4. **Get Workflow Details**
|
|
596
698
|
```python
|
|
597
699
|
# Get workflow by ID
|
|
598
|
-
workflow = client.
|
|
700
|
+
workflow = client.workflows.get("workflow-id")
|
|
599
701
|
|
|
600
702
|
# Get prebuilt workflows
|
|
601
|
-
prebuilt_workflows = client.
|
|
703
|
+
prebuilt_workflows = client.workflows.get_prebuilt()
|
|
602
704
|
```
|
|
603
705
|
|
|
604
706
|
5. **Delete Workflow**
|
|
605
707
|
```python
|
|
606
|
-
result = client.
|
|
708
|
+
result = client.workflows.delete("workflow-id")
|
|
607
709
|
```
|
|
608
710
|
|
|
609
711
|
#### Workflow Execution
|
|
@@ -613,7 +715,7 @@ The SDK provides comprehensive workflow execution management through the Workflo
|
|
|
613
715
|
1. **Run Workflow (with MCP header propagation)**
|
|
614
716
|
```python
|
|
615
717
|
# Enable propagation in payload and pass X-* headers to forward to MCP servers
|
|
616
|
-
execution = client.
|
|
718
|
+
execution = client.workflows.run(
|
|
617
719
|
"workflow-id",
|
|
618
720
|
user_input="optional input",
|
|
619
721
|
propagate_headers=True,
|
|
@@ -624,7 +726,7 @@ execution = client.workflow.run(
|
|
|
624
726
|
)
|
|
625
727
|
|
|
626
728
|
# Get execution service for advanced operations
|
|
627
|
-
execution_service = client.
|
|
729
|
+
execution_service = client.workflows.executions("workflow-id")
|
|
628
730
|
```
|
|
629
731
|
|
|
630
732
|
2. **Manage Executions**
|
|
@@ -750,7 +852,7 @@ Implement proper error handling for workflow operations:
|
|
|
750
852
|
|
|
751
853
|
```python
|
|
752
854
|
try:
|
|
753
|
-
workflow = client.
|
|
855
|
+
workflow = client.workflows.get("workflow-id")
|
|
754
856
|
except ApiError as e:
|
|
755
857
|
if e.status_code == 404:
|
|
756
858
|
print("Workflow not found")
|
|
@@ -814,18 +916,374 @@ client.conversations.delete("conversation-id")
|
|
|
814
916
|
```
|
|
815
917
|
|
|
816
918
|
|
|
919
|
+
### File Service
|
|
920
|
+
|
|
921
|
+
The File service enables file upload and download operations in CodeMie.
|
|
922
|
+
|
|
923
|
+
#### Core Methods
|
|
924
|
+
|
|
925
|
+
1. **Bulk Upload Files**
|
|
926
|
+
```python
|
|
927
|
+
from pathlib import Path
|
|
928
|
+
|
|
929
|
+
# Upload multiple files
|
|
930
|
+
files = [
|
|
931
|
+
Path("/path/to/file1.pdf"),
|
|
932
|
+
Path("/path/to/file2.txt"),
|
|
933
|
+
Path("/path/to/file3.docx")
|
|
934
|
+
]
|
|
935
|
+
|
|
936
|
+
response = client.files.bulk_upload(files)
|
|
937
|
+
|
|
938
|
+
# Access uploaded file information
|
|
939
|
+
for file_info in response.files:
|
|
940
|
+
print(f"Uploaded: {file_info.name}, ID: {file_info.id}")
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
2. **Get File**
|
|
944
|
+
```python
|
|
945
|
+
# Download file by ID
|
|
946
|
+
file_content = client.files.get_file("file-id")
|
|
947
|
+
|
|
948
|
+
# Save to disk
|
|
949
|
+
with open("downloaded_file.pdf", "wb") as f:
|
|
950
|
+
f.write(file_content)
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
### User Service
|
|
954
|
+
|
|
955
|
+
The User service provides access to user profile and preferences.
|
|
956
|
+
|
|
957
|
+
#### Core Methods
|
|
958
|
+
|
|
959
|
+
1. **Get Current User Profile**
|
|
960
|
+
```python
|
|
961
|
+
# Get current user information
|
|
962
|
+
user = client.users.about_me()
|
|
963
|
+
print(f"User: {user.name}, Email: {user.email}")
|
|
964
|
+
```
|
|
965
|
+
|
|
966
|
+
2. **Get User Data and Preferences**
|
|
967
|
+
```python
|
|
968
|
+
# Get user data and preferences
|
|
969
|
+
user_data = client.users.get_data()
|
|
970
|
+
```
|
|
971
|
+
|
|
972
|
+
### Task Service
|
|
973
|
+
|
|
974
|
+
The Task service enables monitoring of background tasks.
|
|
975
|
+
|
|
976
|
+
#### Core Methods
|
|
977
|
+
|
|
978
|
+
1. **Get Background Task**
|
|
979
|
+
```python
|
|
980
|
+
# Get background task status by ID
|
|
981
|
+
task = client.tasks.get("task-id")
|
|
982
|
+
print(f"Task Status: {task.status}")
|
|
983
|
+
print(f"Progress: {task.progress}")
|
|
984
|
+
```
|
|
985
|
+
|
|
817
986
|
### Webhook Service
|
|
818
987
|
|
|
819
|
-
The Webhook service provides access to trigger available
|
|
988
|
+
The Webhook service provides access to trigger available webhooks in CodeMie.
|
|
820
989
|
|
|
821
990
|
#### Core Methods
|
|
822
991
|
|
|
823
|
-
1. **
|
|
992
|
+
1. **Trigger Webhook**
|
|
824
993
|
```python
|
|
825
|
-
# Trigger assistant/workflow/datasource by
|
|
994
|
+
# Trigger assistant/workflow/datasource by its ID
|
|
826
995
|
# Data - body of the post method
|
|
827
|
-
response = client.webhook.trigger("resource_id", "
|
|
996
|
+
response = client.webhook.trigger("resource_id", {"key": "value"})
|
|
997
|
+
```
|
|
998
|
+
|
|
999
|
+
### Vendor Services
|
|
1000
|
+
|
|
1001
|
+
The Vendor Services enable integration with cloud providers to access and manage their native AI assistants, workflows, knowledge bases, and guardrails. Currently, only AWS is supported.
|
|
1002
|
+
|
|
1003
|
+
#### Vendor Assistant Service
|
|
1004
|
+
|
|
1005
|
+
Manage cloud vendor assistants (AWS Bedrock Agents).
|
|
1006
|
+
|
|
1007
|
+
**Core Methods:**
|
|
1008
|
+
|
|
1009
|
+
1. **Get Assistant Settings**
|
|
1010
|
+
```python
|
|
1011
|
+
from codemie_sdk.models.vendor_assistant import VendorType
|
|
1012
|
+
|
|
1013
|
+
# Get AWS assistant settings with pagination
|
|
1014
|
+
settings = client.vendor_assistants.get_assistant_settings(
|
|
1015
|
+
vendor=VendorType.AWS,
|
|
1016
|
+
page=0,
|
|
1017
|
+
per_page=10
|
|
1018
|
+
)
|
|
1019
|
+
|
|
1020
|
+
# Or use string
|
|
1021
|
+
settings = client.vendor_assistants.get_assistant_settings("aws", page=0, per_page=10)
|
|
1022
|
+
```
|
|
1023
|
+
|
|
1024
|
+
2. **Get Assistants**
|
|
1025
|
+
```python
|
|
1026
|
+
# Get assistants for a specific vendor setting
|
|
1027
|
+
assistants = client.vendor_assistants.get_assistants(
|
|
1028
|
+
vendor=VendorType.AWS,
|
|
1029
|
+
setting_id="cac90788-39b7-4ffe-8b57-e8b047fa1f6c",
|
|
1030
|
+
per_page=8,
|
|
1031
|
+
next_token=None # For pagination
|
|
1032
|
+
)
|
|
1033
|
+
|
|
1034
|
+
# Access assistant data
|
|
1035
|
+
for assistant in assistants.data:
|
|
1036
|
+
print(f"Assistant: {assistant.name}, ID: {assistant.id}")
|
|
1037
|
+
```
|
|
1038
|
+
|
|
1039
|
+
3. **Get Assistant Details**
|
|
1040
|
+
```python
|
|
1041
|
+
# Get specific assistant
|
|
1042
|
+
assistant = client.vendor_assistants.get_assistant(
|
|
1043
|
+
vendor=VendorType.AWS,
|
|
1044
|
+
setting_id="setting-id",
|
|
1045
|
+
assistant_id="assistant-id"
|
|
1046
|
+
)
|
|
1047
|
+
|
|
1048
|
+
# Get assistant versions
|
|
1049
|
+
versions = client.vendor_assistants.get_assistant_versions(
|
|
1050
|
+
vendor=VendorType.AWS,
|
|
1051
|
+
setting_id="setting-id",
|
|
1052
|
+
assistant_id="assistant-id"
|
|
1053
|
+
)
|
|
828
1054
|
```
|
|
1055
|
+
|
|
1056
|
+
4. **Get Assistant Aliases**
|
|
1057
|
+
```python
|
|
1058
|
+
# Get aliases for an assistant
|
|
1059
|
+
aliases = client.vendor_assistants.get_assistant_aliases(
|
|
1060
|
+
vendor=VendorType.AWS,
|
|
1061
|
+
setting_id="setting-id",
|
|
1062
|
+
assistant_id="assistant-id"
|
|
1063
|
+
)
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
5. **Install/Uninstall Assistants**
|
|
1067
|
+
```python
|
|
1068
|
+
from codemie_sdk.models.vendor_assistant import VendorAssistantInstallRequest
|
|
1069
|
+
|
|
1070
|
+
# Install assistant
|
|
1071
|
+
install_request = VendorAssistantInstallRequest(
|
|
1072
|
+
assistant_id="assistant-id",
|
|
1073
|
+
version="1.0",
|
|
1074
|
+
project="project-name"
|
|
1075
|
+
)
|
|
1076
|
+
|
|
1077
|
+
response = client.vendor_assistants.install_assistant(
|
|
1078
|
+
vendor=VendorType.AWS,
|
|
1079
|
+
setting_id="setting-id",
|
|
1080
|
+
request=install_request
|
|
1081
|
+
)
|
|
1082
|
+
|
|
1083
|
+
# Uninstall assistant
|
|
1084
|
+
response = client.vendor_assistants.uninstall_assistant(
|
|
1085
|
+
vendor=VendorType.AWS,
|
|
1086
|
+
setting_id="setting-id",
|
|
1087
|
+
assistant_id="assistant-id"
|
|
1088
|
+
)
|
|
1089
|
+
```
|
|
1090
|
+
|
|
1091
|
+
#### Vendor Workflow Service
|
|
1092
|
+
|
|
1093
|
+
Manage cloud vendor workflows (AWS Step Functions).
|
|
1094
|
+
|
|
1095
|
+
**Core Methods:**
|
|
1096
|
+
|
|
1097
|
+
1. **Get Workflow Settings**
|
|
1098
|
+
```python
|
|
1099
|
+
# Get workflow settings for a vendor
|
|
1100
|
+
settings = client.vendor_workflows.get_workflow_settings(
|
|
1101
|
+
vendor=VendorType.AWS,
|
|
1102
|
+
page=0,
|
|
1103
|
+
per_page=10
|
|
1104
|
+
)
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
2. **Get Workflows**
|
|
1108
|
+
```python
|
|
1109
|
+
# Get workflows for a specific setting
|
|
1110
|
+
workflows = client.vendor_workflows.get_workflows(
|
|
1111
|
+
vendor=VendorType.AWS,
|
|
1112
|
+
setting_id="setting-id",
|
|
1113
|
+
per_page=10,
|
|
1114
|
+
next_token=None
|
|
1115
|
+
)
|
|
1116
|
+
```
|
|
1117
|
+
|
|
1118
|
+
3. **Get Workflow Details**
|
|
1119
|
+
```python
|
|
1120
|
+
# Get specific workflow
|
|
1121
|
+
workflow = client.vendor_workflows.get_workflow(
|
|
1122
|
+
vendor=VendorType.AWS,
|
|
1123
|
+
setting_id="setting-id",
|
|
1124
|
+
workflow_id="workflow-id"
|
|
1125
|
+
)
|
|
1126
|
+
```
|
|
1127
|
+
|
|
1128
|
+
4. **Install/Uninstall Workflows**
|
|
1129
|
+
```python
|
|
1130
|
+
from codemie_sdk.models.vendor_workflow import VendorWorkflowInstallRequest
|
|
1131
|
+
|
|
1132
|
+
# Install workflow
|
|
1133
|
+
install_request = VendorWorkflowInstallRequest(
|
|
1134
|
+
workflow_id="workflow-id",
|
|
1135
|
+
project="project-name"
|
|
1136
|
+
)
|
|
1137
|
+
|
|
1138
|
+
response = client.vendor_workflows.install_workflow(
|
|
1139
|
+
vendor=VendorType.AWS,
|
|
1140
|
+
setting_id="setting-id",
|
|
1141
|
+
request=install_request
|
|
1142
|
+
)
|
|
1143
|
+
|
|
1144
|
+
# Uninstall workflow
|
|
1145
|
+
response = client.vendor_workflows.uninstall_workflow(
|
|
1146
|
+
vendor=VendorType.AWS,
|
|
1147
|
+
setting_id="setting-id",
|
|
1148
|
+
workflow_id="workflow-id"
|
|
1149
|
+
)
|
|
1150
|
+
```
|
|
1151
|
+
|
|
1152
|
+
#### Vendor Knowledge Base Service
|
|
1153
|
+
|
|
1154
|
+
Manage cloud vendor knowledge bases (AWS Bedrock Knowledge Bases).
|
|
1155
|
+
|
|
1156
|
+
**Core Methods:**
|
|
1157
|
+
|
|
1158
|
+
1. **Get Knowledge Base Settings**
|
|
1159
|
+
```python
|
|
1160
|
+
# Get knowledge base settings for a vendor
|
|
1161
|
+
settings = client.vendor_knowledgebases.get_knowledgebase_settings(
|
|
1162
|
+
vendor=VendorType.AWS,
|
|
1163
|
+
page=0,
|
|
1164
|
+
per_page=10
|
|
1165
|
+
)
|
|
1166
|
+
```
|
|
1167
|
+
|
|
1168
|
+
2. **Get Knowledge Bases**
|
|
1169
|
+
```python
|
|
1170
|
+
# Get knowledge bases for a specific setting
|
|
1171
|
+
kbs = client.vendor_knowledgebases.get_knowledgebases(
|
|
1172
|
+
vendor=VendorType.AWS,
|
|
1173
|
+
setting_id="setting-id",
|
|
1174
|
+
per_page=10,
|
|
1175
|
+
next_token=None
|
|
1176
|
+
)
|
|
1177
|
+
```
|
|
1178
|
+
|
|
1179
|
+
3. **Get Knowledge Base Details**
|
|
1180
|
+
```python
|
|
1181
|
+
# Get specific knowledge base with details
|
|
1182
|
+
kb_detail = client.vendor_knowledgebases.get_knowledgebase_detail(
|
|
1183
|
+
vendor=VendorType.AWS,
|
|
1184
|
+
setting_id="setting-id",
|
|
1185
|
+
kb_id="kb-id"
|
|
1186
|
+
)
|
|
1187
|
+
```
|
|
1188
|
+
|
|
1189
|
+
4. **Install/Uninstall Knowledge Bases**
|
|
1190
|
+
```python
|
|
1191
|
+
from codemie_sdk.models.vendor_knowledgebase import VendorKnowledgeBaseInstallRequest
|
|
1192
|
+
|
|
1193
|
+
# Install knowledge base
|
|
1194
|
+
install_request = VendorKnowledgeBaseInstallRequest(
|
|
1195
|
+
kb_id="kb-id",
|
|
1196
|
+
project="project-name"
|
|
1197
|
+
)
|
|
1198
|
+
|
|
1199
|
+
response = client.vendor_knowledgebases.install_knowledgebase(
|
|
1200
|
+
vendor=VendorType.AWS,
|
|
1201
|
+
setting_id="setting-id",
|
|
1202
|
+
request=install_request
|
|
1203
|
+
)
|
|
1204
|
+
|
|
1205
|
+
# Uninstall knowledge base
|
|
1206
|
+
response = client.vendor_knowledgebases.uninstall_knowledgebase(
|
|
1207
|
+
vendor=VendorType.AWS,
|
|
1208
|
+
setting_id="setting-id",
|
|
1209
|
+
kb_id="kb-id"
|
|
1210
|
+
)
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
#### Vendor Guardrail Service
|
|
1214
|
+
|
|
1215
|
+
Manage cloud vendor guardrails (AWS Bedrock Guardrails).
|
|
1216
|
+
|
|
1217
|
+
**Core Methods:**
|
|
1218
|
+
|
|
1219
|
+
1. **Get Guardrail Settings**
|
|
1220
|
+
```python
|
|
1221
|
+
# Get guardrail settings for a vendor
|
|
1222
|
+
settings = client.vendor_guardrails.get_guardrail_settings(
|
|
1223
|
+
vendor=VendorType.AWS,
|
|
1224
|
+
page=0,
|
|
1225
|
+
per_page=10
|
|
1226
|
+
)
|
|
1227
|
+
|
|
1228
|
+
# Check for invalid settings
|
|
1229
|
+
for setting in settings.data:
|
|
1230
|
+
if setting.invalid:
|
|
1231
|
+
print(f"Error: {setting.error}")
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
2. **Get Guardrails**
|
|
1235
|
+
```python
|
|
1236
|
+
# Get guardrails for a specific setting
|
|
1237
|
+
guardrails = client.vendor_guardrails.get_guardrails(
|
|
1238
|
+
vendor=VendorType.AWS,
|
|
1239
|
+
setting_id="setting-id",
|
|
1240
|
+
per_page=10,
|
|
1241
|
+
next_token=None
|
|
1242
|
+
)
|
|
1243
|
+
```
|
|
1244
|
+
|
|
1245
|
+
3. **Get Guardrail Details and Versions**
|
|
1246
|
+
```python
|
|
1247
|
+
# Get specific guardrail
|
|
1248
|
+
guardrail = client.vendor_guardrails.get_guardrail(
|
|
1249
|
+
vendor=VendorType.AWS,
|
|
1250
|
+
setting_id="setting-id",
|
|
1251
|
+
guardrail_id="guardrail-id"
|
|
1252
|
+
)
|
|
1253
|
+
|
|
1254
|
+
# Get guardrail versions
|
|
1255
|
+
versions = client.vendor_guardrails.get_guardrail_versions(
|
|
1256
|
+
vendor=VendorType.AWS,
|
|
1257
|
+
setting_id="setting-id",
|
|
1258
|
+
guardrail_id="guardrail-id"
|
|
1259
|
+
)
|
|
1260
|
+
```
|
|
1261
|
+
|
|
1262
|
+
4. **Install/Uninstall Guardrails**
|
|
1263
|
+
```python
|
|
1264
|
+
from codemie_sdk.models.vendor_guardrail import VendorGuardrailInstallRequest
|
|
1265
|
+
|
|
1266
|
+
# Install guardrail
|
|
1267
|
+
install_request = VendorGuardrailInstallRequest(
|
|
1268
|
+
guardrail_id="guardrail-id",
|
|
1269
|
+
version="1.0",
|
|
1270
|
+
project="project-name"
|
|
1271
|
+
)
|
|
1272
|
+
|
|
1273
|
+
response = client.vendor_guardrails.install_guardrail(
|
|
1274
|
+
vendor=VendorType.AWS,
|
|
1275
|
+
setting_id="setting-id",
|
|
1276
|
+
request=install_request
|
|
1277
|
+
)
|
|
1278
|
+
|
|
1279
|
+
# Uninstall guardrail
|
|
1280
|
+
response = client.vendor_guardrails.uninstall_guardrail(
|
|
1281
|
+
vendor=VendorType.AWS,
|
|
1282
|
+
setting_id="setting-id",
|
|
1283
|
+
guardrail_id="guardrail-id"
|
|
1284
|
+
)
|
|
1285
|
+
```
|
|
1286
|
+
|
|
829
1287
|
## Error Handling
|
|
830
1288
|
|
|
831
1289
|
The SDK implements comprehensive error handling. All API calls may raise exceptions for:
|
|
@@ -907,153 +1365,40 @@ client = CodeMieClient(
|
|
|
907
1365
|
)
|
|
908
1366
|
```
|
|
909
1367
|
|
|
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
|
-
|
|
954
1368
|
## Support
|
|
955
|
-
For providing credentials please contact AI/Run CodeMie Team: Vadym_Vlasenko@epam.com or Nikita_Levyankov@epam.com
|
|
956
|
-
|
|
957
|
-
## Running tests
|
|
958
|
-
|
|
959
|
-
For running tests on custom environment you should create .env file in the ./tests directory,
|
|
960
|
-
ask QA team: anton_yeromin@epam.com to provide all needed testing credentials. Under this directory there are stubs
|
|
961
|
-
for .env files for running tests on local and preview environments.
|
|
962
|
-
|
|
963
|
-
Configuration example:
|
|
964
|
-
|
|
965
|
-
``` properties
|
|
966
|
-
|
|
967
|
-
AUTH_SERVER_URL=https://keycloak.eks-core.aws.main.edp.projects.epam.com/auth
|
|
968
|
-
AUTH_CLIENT_ID=codemie-preview
|
|
969
|
-
AUTH_CLIENT_SECRET=<auth_clienbt_secret>
|
|
970
|
-
AUTH_REALM_NAME=codemie-prod
|
|
971
|
-
CODEMIE_API_DOMAIN=http://localhost:8080
|
|
972
|
-
VERIFY_SSL=False
|
|
973
|
-
|
|
974
|
-
NATS_URL=nats://localhost:4222
|
|
975
|
-
|
|
976
|
-
ENV=local
|
|
977
|
-
CLEANUP_DATA=True
|
|
978
|
-
|
|
979
|
-
AUTH_USERNAME=<username>
|
|
980
|
-
AUTH_PASSWORD=<password>
|
|
981
|
-
TEST_USER_FULL_NAME=<user_full_name>
|
|
982
|
-
|
|
983
|
-
PROJECT_NAME=codemie
|
|
984
|
-
GIT_ENV=gitlab
|
|
985
|
-
|
|
986
|
-
DEFAULT_TIMEOUT=60
|
|
987
|
-
|
|
988
|
-
GITLAB_URL=https://gitbud.epam.com
|
|
989
|
-
GITLAB_TOKEN=<gitlab_token>
|
|
990
|
-
GITLAB_PROJECT=https://gitbud.epam.com/epm-cdme/autotests/codemie-test-project
|
|
991
|
-
GITLAB_PROJECT_ID=17889
|
|
992
|
-
|
|
993
|
-
GITHUB_URL=https://github.com
|
|
994
|
-
GITHUB_TOKEN=<github_token>
|
|
995
|
-
GITHUB_PROJECT=https://github.com/wild47/final_task
|
|
996
|
-
|
|
997
|
-
JIRA_URL=https://jiraeu.epam.com
|
|
998
|
-
JIRA_TOKEN=<jira_token>
|
|
999
|
-
JQL="project = 'EPMCDME' and issuetype = 'Epic' and status = 'Closed'"
|
|
1000
1369
|
|
|
1001
|
-
|
|
1002
|
-
CONFLUENCE_TOKEN=<confluence_token>
|
|
1003
|
-
CQL="space = EPMCDME and type = page and title = 'AQA Backlog Estimation'"
|
|
1004
|
-
|
|
1005
|
-
AWS_ACCESS_KEY=<aws_access_token>
|
|
1006
|
-
AWS_SECRET_KEY=<aws_secret_key>
|
|
1007
|
-
|
|
1008
|
-
RP_API_KEY=<report_portal_key_optional>
|
|
1009
|
-
```
|
|
1370
|
+
For providing credentials please contact AI/Run CodeMie Team: Vadym_Vlasenko@epam.com or Nikita_Levyankov@epam.com
|
|
1010
1371
|
|
|
1011
|
-
|
|
1372
|
+
## Development
|
|
1012
1373
|
|
|
1013
|
-
|
|
1014
|
-
pytest -n 10 --reruns 2
|
|
1015
|
-
```
|
|
1374
|
+
### Setup
|
|
1016
1375
|
|
|
1017
|
-
|
|
1376
|
+
```bash
|
|
1377
|
+
# Install dependencies
|
|
1378
|
+
poetry install
|
|
1018
1379
|
|
|
1019
|
-
|
|
1020
|
-
|
|
1380
|
+
# Or using make
|
|
1381
|
+
make install
|
|
1021
1382
|
```
|
|
1022
1383
|
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
First you have to install playwright browsers:
|
|
1384
|
+
### Code Quality
|
|
1026
1385
|
|
|
1027
|
-
```
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
and then
|
|
1386
|
+
```bash
|
|
1387
|
+
# Run linter (check and fix)
|
|
1388
|
+
make ruff
|
|
1031
1389
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1390
|
+
# Or manually
|
|
1391
|
+
poetry run ruff check --fix
|
|
1392
|
+
poetry run ruff format
|
|
1034
1393
|
```
|
|
1035
1394
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
Run tests for e2e tests for specific integration/tool.
|
|
1039
|
-
Available marks:
|
|
1040
|
-
- jira_kb
|
|
1041
|
-
- confluence_kb
|
|
1042
|
-
- code_kb
|
|
1043
|
-
- gitlab
|
|
1044
|
-
- github
|
|
1045
|
-
- git
|
|
1046
|
-
|
|
1047
|
-
```shell
|
|
1048
|
-
pytest -n 10 -m "jira_kb or github" --reruns 2
|
|
1049
|
-
```
|
|
1395
|
+
### Building Package
|
|
1050
1396
|
|
|
1051
|
-
|
|
1397
|
+
```bash
|
|
1398
|
+
# Build package
|
|
1399
|
+
poetry build
|
|
1400
|
+
# Or make build
|
|
1052
1401
|
|
|
1053
|
-
|
|
1054
|
-
|
|
1402
|
+
# Publish to PyPI
|
|
1403
|
+
make publish
|
|
1055
1404
|
```
|
|
1056
|
-
|
|
1057
|
-
ReportPortal link is available by the following URL: https://report-portal.core.kuberocketci.io/ui/#epm-cdme/launches/all
|
|
1058
|
-
|
|
1059
|
-
If you do not have access to the project ask Anton Yeromin (anton_yeromin@epam.com) to add you.
|