pygeai 0.2.7b36__py3-none-any.whl → 0.2.7b38__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.
- pygeai/core/base/mappers.py +11 -2
- pygeai/core/models.py +20 -11
- pygeai/lab/managers.py +54 -129
- pygeai/organization/responses.py +23 -0
- pygeai/tests/health/__init__.py +0 -0
- pygeai/tests/health/test_clients.py +40 -0
- pygeai/tests/integration/lab/agents/test_create_agent.py +39 -34
- pygeai/tests/integration/lab/agents/test_create_sharing_link.py +101 -0
- pygeai/tests/integration/lab/agents/test_delete_agent.py +100 -0
- pygeai/tests/integration/lab/agents/test_get_agent.py +12 -7
- pygeai/tests/integration/lab/agents/test_publish_agent_revision.py +139 -0
- pygeai/tests/integration/lab/agents/test_update_agent.py +69 -42
- pygeai/tests/lab/test_managers.py +45 -45
- pygeai/tests/organization/test_mappers.py +146 -0
- pygeai/tests/snippets/lab/agents/create_agent.py +1 -5
- pygeai/tests/snippets/lab/agents/create_agent_2.py +1 -5
- pygeai/tests/snippets/lab/agents/delete_agent.py +1 -5
- pygeai/tests/snippets/lab/agents/get_agent.py +2 -11
- pygeai/tests/snippets/lab/agents/get_sharing_link.py +3 -7
- pygeai/tests/snippets/lab/agents/list_agents.py +2 -6
- pygeai/tests/snippets/lab/agents/publish_agent_revision.py +2 -6
- pygeai/tests/snippets/lab/agents/update_agent.py +1 -5
- pygeai/tests/snippets/lab/processes/create_process.py +3 -5
- pygeai/tests/snippets/lab/processes/create_task.py +3 -5
- pygeai/tests/snippets/lab/processes/jobs/list_jobs.py +10 -19
- pygeai/tests/snippets/lab/processes/kbs/create_kb.py +2 -5
- pygeai/tests/snippets/lab/processes/kbs/get_kb.py +10 -16
- pygeai/tests/snippets/lab/processes/kbs/list_kbs.py +13 -20
- pygeai/tests/snippets/lab/processes/kbs/try_all.py +5 -7
- pygeai/tests/snippets/lab/processes/list_processes.py +5 -7
- pygeai/tests/snippets/lab/strategies/create_reasoning_strategy.py +2 -5
- pygeai/tests/snippets/lab/strategies/get_reasoning_strategy.py +2 -5
- pygeai/tests/snippets/lab/strategies/list_reasoning_strategies.py +3 -6
- pygeai/tests/snippets/lab/strategies/update_reasoning_strategy.py +2 -5
- pygeai/tests/snippets/lab/tools/create_tool.py +3 -7
- pygeai/tests/snippets/lab/tools/delete_tool.py +2 -6
- pygeai/tests/snippets/lab/tools/get_parameter.py +5 -7
- pygeai/tests/snippets/lab/tools/get_tool.py +5 -7
- pygeai/tests/snippets/lab/tools/list_tools.py +3 -7
- pygeai/tests/snippets/lab/tools/publish_tool_revision.py +3 -5
- pygeai/tests/snippets/lab/tools/set_parameters.py +4 -9
- pygeai/tests/snippets/lab/tools/update_tool.py +4 -8
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/METADATA +1 -1
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/RECORD +48 -42
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/WHEEL +0 -0
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/entry_points.txt +0 -0
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/licenses/LICENSE +0 -0
- {pygeai-0.2.7b36.dist-info → pygeai-0.2.7b38.dist-info}/top_level.txt +0 -0
pygeai/lab/managers.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from typing import Union, Optional, List
|
|
2
2
|
|
|
3
3
|
from pygeai import logger
|
|
4
|
+
from pygeai.admin.clients import AdminClient
|
|
4
5
|
from pygeai.core.base.mappers import ResponseMapper
|
|
5
6
|
from pygeai.core.base.responses import EmptyResponse
|
|
6
7
|
from pygeai.core.common.exceptions import APIError, MissingRequirementException
|
|
@@ -21,15 +22,24 @@ from pygeai.lab.tools.mappers import ToolMapper
|
|
|
21
22
|
|
|
22
23
|
class AILabManager:
|
|
23
24
|
|
|
24
|
-
def __init__(self, api_key: str = None, base_url: str = None, alias: str = "default"):
|
|
25
|
+
def __init__(self, api_key: str = None, base_url: str = None, alias: str = "default", project_id: str = None):
|
|
25
26
|
self.__agent_client = AgentClient(api_key=api_key, base_url=base_url, alias=alias)
|
|
26
27
|
self.__tool_client = ToolClient(api_key=api_key, base_url=base_url, alias=alias)
|
|
27
28
|
self.__reasoning_strategy_client = ReasoningStrategyClient(api_key=api_key, base_url=base_url, alias=alias)
|
|
28
29
|
self.__process_client = AgenticProcessClient(api_key=api_key, base_url=base_url, alias=alias)
|
|
30
|
+
self.project_id = self.__get_project_id() if not project_id else project_id
|
|
31
|
+
|
|
32
|
+
def __get_project_id(self):
|
|
33
|
+
response = None
|
|
34
|
+
try:
|
|
35
|
+
response = AdminClient().validate_api_token()
|
|
36
|
+
return response.get("projectId")
|
|
37
|
+
except Exception as e:
|
|
38
|
+
logger.error(f"Error retrieving project_id from GEAI. Response: {response}: {e}")
|
|
39
|
+
raise APIError(f"Error retrieving project_id from GEAI: {e}")
|
|
29
40
|
|
|
30
41
|
def get_agent_list(
|
|
31
42
|
self,
|
|
32
|
-
project_id: str,
|
|
33
43
|
filter_settings: Optional[FilterSettings] = None
|
|
34
44
|
) -> AgentList:
|
|
35
45
|
"""
|
|
@@ -38,7 +48,6 @@ class AILabManager:
|
|
|
38
48
|
This method queries the agent client to fetch a list of agents associated with the specified
|
|
39
49
|
project ID, applying the provided filter settings.
|
|
40
50
|
|
|
41
|
-
:param project_id: The ID of the project to retrieve agents for.
|
|
42
51
|
:param filter_settings: The filter settings to apply to the agent list query.
|
|
43
52
|
Includes fields such as status, start, count, access_scope, allow_drafts, and allow_external.
|
|
44
53
|
:return: An `AgentList` containing the retrieved agents.
|
|
@@ -48,7 +57,7 @@ class AILabManager:
|
|
|
48
57
|
filter_settings = FilterSettings()
|
|
49
58
|
|
|
50
59
|
response_data = self.__agent_client.list_agents(
|
|
51
|
-
project_id=project_id,
|
|
60
|
+
project_id=self.project_id,
|
|
52
61
|
status=filter_settings.status,
|
|
53
62
|
start=filter_settings.start,
|
|
54
63
|
count=filter_settings.count,
|
|
@@ -66,7 +75,6 @@ class AILabManager:
|
|
|
66
75
|
|
|
67
76
|
def create_agent(
|
|
68
77
|
self,
|
|
69
|
-
project_id: str,
|
|
70
78
|
agent: Agent,
|
|
71
79
|
automatic_publish: bool = False
|
|
72
80
|
) -> Agent:
|
|
@@ -76,7 +84,6 @@ class AILabManager:
|
|
|
76
84
|
This method sends a request to the agent client to create an agent based on the attributes
|
|
77
85
|
of the provided `Agent` object.
|
|
78
86
|
|
|
79
|
-
:param project_id: Unique identifier of the project where the agent will be created.
|
|
80
87
|
:param agent: The agent configuration object containing all necessary details,
|
|
81
88
|
including name, access scope, public name, job description, avatar image, description,
|
|
82
89
|
and agent data (prompt, LLM config, and models).
|
|
@@ -86,7 +93,7 @@ class AILabManager:
|
|
|
86
93
|
:raises APIError: If the API returns errors.
|
|
87
94
|
"""
|
|
88
95
|
response_data = self.__agent_client.create_agent(
|
|
89
|
-
project_id=project_id,
|
|
96
|
+
project_id=self.project_id,
|
|
90
97
|
name=agent.name,
|
|
91
98
|
access_scope=agent.access_scope,
|
|
92
99
|
public_name=agent.public_name,
|
|
@@ -109,7 +116,6 @@ class AILabManager:
|
|
|
109
116
|
|
|
110
117
|
def update_agent(
|
|
111
118
|
self,
|
|
112
|
-
project_id: str,
|
|
113
119
|
agent: Agent,
|
|
114
120
|
automatic_publish: bool = False,
|
|
115
121
|
upsert: bool = False
|
|
@@ -121,7 +127,6 @@ class AILabManager:
|
|
|
121
127
|
based on the attributes of the provided `Agent` object. It can optionally publish the agent
|
|
122
128
|
automatically or perform an upsert if the agent doesn’t exist.
|
|
123
129
|
|
|
124
|
-
:param project_id: Unique identifier of the project where the agent resides.
|
|
125
130
|
:param agent: The agent configuration object containing updated details,
|
|
126
131
|
including id, name, access scope, public name, job description, avatar image, description,
|
|
127
132
|
and agent data (prompt, LLM config, and models).
|
|
@@ -134,7 +139,7 @@ class AILabManager:
|
|
|
134
139
|
:raises APIError: If the API returns errors.
|
|
135
140
|
"""
|
|
136
141
|
response_data = self.__agent_client.update_agent(
|
|
137
|
-
project_id=project_id,
|
|
142
|
+
project_id=self.project_id,
|
|
138
143
|
agent_id=agent.id,
|
|
139
144
|
name=agent.name,
|
|
140
145
|
access_scope=agent.access_scope,
|
|
@@ -158,7 +163,6 @@ class AILabManager:
|
|
|
158
163
|
|
|
159
164
|
def get_agent(
|
|
160
165
|
self,
|
|
161
|
-
project_id: str,
|
|
162
166
|
agent_id: str,
|
|
163
167
|
filter_settings: Optional[FilterSettings] = None
|
|
164
168
|
) -> Agent:
|
|
@@ -169,7 +173,6 @@ class AILabManager:
|
|
|
169
173
|
from the specified project. Optional filter settings can be provided to specify the revision,
|
|
170
174
|
version, and whether to allow drafts.
|
|
171
175
|
|
|
172
|
-
:param project_id: Unique identifier of the project where the agent resides.
|
|
173
176
|
:param agent_id: Unique identifier of the agent to retrieve.
|
|
174
177
|
:param filter_settings: Settings to filter the agent retrieval,
|
|
175
178
|
including revision (defaults to "0"), version (defaults to "0"), and allow_drafts (defaults to True).
|
|
@@ -184,7 +187,7 @@ class AILabManager:
|
|
|
184
187
|
)
|
|
185
188
|
|
|
186
189
|
response_data = self.__agent_client.get_agent(
|
|
187
|
-
project_id=project_id,
|
|
190
|
+
project_id=self.project_id,
|
|
188
191
|
agent_id=agent_id,
|
|
189
192
|
revision=filter_settings.revision,
|
|
190
193
|
version=filter_settings.version,
|
|
@@ -200,7 +203,6 @@ class AILabManager:
|
|
|
200
203
|
|
|
201
204
|
def create_sharing_link(
|
|
202
205
|
self,
|
|
203
|
-
project_id: str,
|
|
204
206
|
agent_id: str
|
|
205
207
|
) -> SharingLink:
|
|
206
208
|
"""
|
|
@@ -209,13 +211,12 @@ class AILabManager:
|
|
|
209
211
|
This method sends a request to the agent client to create a sharing link for the agent
|
|
210
212
|
identified by `agent_id` in the specified project.
|
|
211
213
|
|
|
212
|
-
:param project_id: Unique identifier of the project where the agent resides.
|
|
213
214
|
:param agent_id: Unique identifier of the agent for which to create a sharing link.
|
|
214
215
|
:return: A `SharingLink` object representing the sharing link details.
|
|
215
216
|
:raises APIError: If the API returns errors.
|
|
216
217
|
"""
|
|
217
218
|
response_data = self.__agent_client.create_sharing_link(
|
|
218
|
-
project_id=project_id,
|
|
219
|
+
project_id=self.project_id,
|
|
219
220
|
agent_id=agent_id
|
|
220
221
|
)
|
|
221
222
|
if ErrorHandler.has_errors(response_data):
|
|
@@ -228,7 +229,6 @@ class AILabManager:
|
|
|
228
229
|
|
|
229
230
|
def publish_agent_revision(
|
|
230
231
|
self,
|
|
231
|
-
project_id: str,
|
|
232
232
|
agent_id: str,
|
|
233
233
|
revision: str
|
|
234
234
|
) -> Agent:
|
|
@@ -238,14 +238,13 @@ class AILabManager:
|
|
|
238
238
|
This method sends a request to the agent client to publish the specified revision of the agent
|
|
239
239
|
identified by `agent_id` in the specified project.
|
|
240
240
|
|
|
241
|
-
:param project_id: Unique identifier of the project where the agent resides.
|
|
242
241
|
:param agent_id: Unique identifier of the agent to publish.
|
|
243
242
|
:param revision: Revision of the agent to publish.
|
|
244
243
|
:return: An `Agent` object representing the published agent.
|
|
245
244
|
:raises APIError: If the API returns errors.
|
|
246
245
|
"""
|
|
247
246
|
response_data = self.__agent_client.publish_agent_revision(
|
|
248
|
-
project_id=project_id,
|
|
247
|
+
project_id=self.project_id,
|
|
249
248
|
agent_id=agent_id,
|
|
250
249
|
revision=revision
|
|
251
250
|
)
|
|
@@ -259,7 +258,6 @@ class AILabManager:
|
|
|
259
258
|
|
|
260
259
|
def delete_agent(
|
|
261
260
|
self,
|
|
262
|
-
project_id: str,
|
|
263
261
|
agent_id: str
|
|
264
262
|
) -> EmptyResponse:
|
|
265
263
|
"""
|
|
@@ -268,13 +266,12 @@ class AILabManager:
|
|
|
268
266
|
This method sends a request to the agent client to delete the agent identified by `agent_id`
|
|
269
267
|
from the specified project.
|
|
270
268
|
|
|
271
|
-
:param project_id: Unique identifier of the project where the agent resides.
|
|
272
269
|
:param agent_id: Unique identifier of the agent to delete.
|
|
273
270
|
:return: `EmptyResponse` if the agent was deleted successfully.
|
|
274
271
|
:raises APIError: If the API returns errors.
|
|
275
272
|
"""
|
|
276
273
|
response_data = self.__agent_client.delete_agent(
|
|
277
|
-
project_id=project_id,
|
|
274
|
+
project_id=self.project_id,
|
|
278
275
|
agent_id=agent_id
|
|
279
276
|
)
|
|
280
277
|
if ErrorHandler.has_errors(response_data):
|
|
@@ -288,7 +285,6 @@ class AILabManager:
|
|
|
288
285
|
|
|
289
286
|
def create_tool(
|
|
290
287
|
self,
|
|
291
|
-
project_id: str,
|
|
292
288
|
tool: Tool,
|
|
293
289
|
automatic_publish: bool = False
|
|
294
290
|
) -> Tool:
|
|
@@ -299,7 +295,6 @@ class AILabManager:
|
|
|
299
295
|
of the provided `Tool` object, including name, description, scope, access_scope, public_name,
|
|
300
296
|
icon, open_api, open_api_json, report_events, and parameters.
|
|
301
297
|
|
|
302
|
-
:param project_id: Unique identifier of the project where the tool will be created.
|
|
303
298
|
:param tool: The tool configuration object containing name, description, scope,
|
|
304
299
|
access_scope, public_name, icon, open_api, open_api_json, report_events, and parameters.
|
|
305
300
|
Optional fields (e.g., id, access_scope) are included if set in the `Tool` object.
|
|
@@ -311,7 +306,7 @@ class AILabManager:
|
|
|
311
306
|
parameters = [param.to_dict() for param in tool.parameters] if tool.parameters else []
|
|
312
307
|
|
|
313
308
|
response_data = self.__tool_client.create_tool(
|
|
314
|
-
project_id=project_id,
|
|
309
|
+
project_id=self.project_id,
|
|
315
310
|
name=tool.name,
|
|
316
311
|
description=tool.description,
|
|
317
312
|
scope=tool.scope,
|
|
@@ -334,7 +329,6 @@ class AILabManager:
|
|
|
334
329
|
|
|
335
330
|
def update_tool(
|
|
336
331
|
self,
|
|
337
|
-
project_id: str,
|
|
338
332
|
tool: Tool,
|
|
339
333
|
automatic_publish: bool = False,
|
|
340
334
|
upsert: bool = False
|
|
@@ -347,7 +341,6 @@ class AILabManager:
|
|
|
347
341
|
access_scope, public_name, icon, open_api, open_api_json, report_events, and parameters.
|
|
348
342
|
It can optionally publish the tool automatically or perform an upsert if the tool doesn’t exist.
|
|
349
343
|
|
|
350
|
-
:param project_id: Unique identifier of the project where the tool resides.
|
|
351
344
|
:param tool: The tool configuration object containing updated details, including
|
|
352
345
|
id, name, description, scope, access_scope, public_name, icon, open_api, open_api_json,
|
|
353
346
|
report_events, and parameters.
|
|
@@ -361,7 +354,7 @@ class AILabManager:
|
|
|
361
354
|
parameters = [param.to_dict() for param in tool.parameters] if tool.parameters else []
|
|
362
355
|
|
|
363
356
|
response_data = self.__tool_client.update_tool(
|
|
364
|
-
project_id=project_id,
|
|
357
|
+
project_id=self.project_id,
|
|
365
358
|
tool_id=tool.id,
|
|
366
359
|
name=tool.name,
|
|
367
360
|
description=tool.description,
|
|
@@ -387,7 +380,6 @@ class AILabManager:
|
|
|
387
380
|
|
|
388
381
|
def get_tool(
|
|
389
382
|
self,
|
|
390
|
-
project_id: str,
|
|
391
383
|
tool_id: str,
|
|
392
384
|
filter_settings: Optional[FilterSettings] = None
|
|
393
385
|
) -> Tool:
|
|
@@ -398,7 +390,6 @@ class AILabManager:
|
|
|
398
390
|
from the specified project. Optional filter settings can be provided to specify the revision,
|
|
399
391
|
version, and whether to allow drafts.
|
|
400
392
|
|
|
401
|
-
:param project_id: Unique identifier of the project where the tool resides.
|
|
402
393
|
:param tool_id: Unique identifier of the tool to retrieve.
|
|
403
394
|
:param filter_settings: Settings to filter the tool retrieval,
|
|
404
395
|
including revision (defaults to "0"), version (defaults to "0"), and allow_drafts (defaults to True).
|
|
@@ -413,7 +404,7 @@ class AILabManager:
|
|
|
413
404
|
)
|
|
414
405
|
|
|
415
406
|
response_data = self.__tool_client.get_tool(
|
|
416
|
-
project_id=project_id,
|
|
407
|
+
project_id=self.project_id,
|
|
417
408
|
tool_id=tool_id,
|
|
418
409
|
revision=filter_settings.revision,
|
|
419
410
|
version=filter_settings.version,
|
|
@@ -430,7 +421,6 @@ class AILabManager:
|
|
|
430
421
|
|
|
431
422
|
def delete_tool(
|
|
432
423
|
self,
|
|
433
|
-
project_id: str,
|
|
434
424
|
tool_id: Optional[str] = None,
|
|
435
425
|
tool_name: Optional[str] = None
|
|
436
426
|
) -> EmptyResponse:
|
|
@@ -440,7 +430,6 @@ class AILabManager:
|
|
|
440
430
|
This method sends a request to the tool client to delete the tool identified by either
|
|
441
431
|
`tool_id` or `tool_name`.
|
|
442
432
|
|
|
443
|
-
:param project_id: Unique identifier of the project where the tool resides.
|
|
444
433
|
:param tool_id: Unique identifier of the tool to delete.
|
|
445
434
|
:param tool_name: Name of the tool to delete.
|
|
446
435
|
:return: `EmptyResponse` if the tool was deleted successfully.
|
|
@@ -451,7 +440,7 @@ class AILabManager:
|
|
|
451
440
|
raise MissingRequirementException("Either tool_id or tool_name must be provided.")
|
|
452
441
|
|
|
453
442
|
response_data = self.__tool_client.delete_tool(
|
|
454
|
-
project_id=project_id,
|
|
443
|
+
project_id=self.project_id,
|
|
455
444
|
tool_id=tool_id,
|
|
456
445
|
tool_name=tool_name
|
|
457
446
|
)
|
|
@@ -467,7 +456,6 @@ class AILabManager:
|
|
|
467
456
|
|
|
468
457
|
def list_tools(
|
|
469
458
|
self,
|
|
470
|
-
project_id: str,
|
|
471
459
|
filter_settings: Optional[FilterSettings] = None
|
|
472
460
|
) -> ToolList:
|
|
473
461
|
"""
|
|
@@ -476,7 +464,6 @@ class AILabManager:
|
|
|
476
464
|
This method queries the tool client to fetch a list of tools for the given project ID,
|
|
477
465
|
applying the specified filter settings.
|
|
478
466
|
|
|
479
|
-
:param project_id: Unique identifier of the project.
|
|
480
467
|
:param filter_settings: Settings to filter the tool list query,
|
|
481
468
|
including id (defaults to ""), count (defaults to "100"), access_scope (defaults to "public"),
|
|
482
469
|
allow_drafts (defaults to True), scope (defaults to "api"), and allow_external (defaults to True).
|
|
@@ -494,7 +481,7 @@ class AILabManager:
|
|
|
494
481
|
)
|
|
495
482
|
|
|
496
483
|
response_data = self.__tool_client.list_tools(
|
|
497
|
-
project_id=project_id,
|
|
484
|
+
project_id=self.project_id,
|
|
498
485
|
id=filter_settings.id,
|
|
499
486
|
count=filter_settings.count,
|
|
500
487
|
access_scope=filter_settings.access_scope,
|
|
@@ -513,7 +500,6 @@ class AILabManager:
|
|
|
513
500
|
|
|
514
501
|
def publish_tool_revision(
|
|
515
502
|
self,
|
|
516
|
-
project_id: str,
|
|
517
503
|
tool_id: str,
|
|
518
504
|
revision: str
|
|
519
505
|
) -> Tool:
|
|
@@ -523,14 +509,13 @@ class AILabManager:
|
|
|
523
509
|
This method sends a request to the tool client to publish the specified revision of the tool
|
|
524
510
|
identified by `tool_id`.
|
|
525
511
|
|
|
526
|
-
:param project_id: Unique identifier of the project where the tool resides.
|
|
527
512
|
:param tool_id: Unique identifier of the tool to publish.
|
|
528
513
|
:param revision: Revision of the tool to publish.
|
|
529
514
|
:return: A `Tool` object representing the published tool.
|
|
530
515
|
:raises APIError: If the API returns errors.
|
|
531
516
|
"""
|
|
532
517
|
response_data = self.__tool_client.publish_tool_revision(
|
|
533
|
-
project_id=project_id,
|
|
518
|
+
project_id=self.project_id,
|
|
534
519
|
tool_id=tool_id,
|
|
535
520
|
revision=revision
|
|
536
521
|
)
|
|
@@ -545,7 +530,6 @@ class AILabManager:
|
|
|
545
530
|
|
|
546
531
|
def get_parameter(
|
|
547
532
|
self,
|
|
548
|
-
project_id: str,
|
|
549
533
|
tool_id: Optional[str] = None,
|
|
550
534
|
tool_public_name: Optional[str] = None,
|
|
551
535
|
filter_settings: Optional[FilterSettings] = None
|
|
@@ -557,7 +541,6 @@ class AILabManager:
|
|
|
557
541
|
by either `tool_id` or `tool_public_name`. Optional filter settings can specify revision,
|
|
558
542
|
version, and whether to allow drafts.
|
|
559
543
|
|
|
560
|
-
:param project_id: Unique identifier of the project.
|
|
561
544
|
:param tool_id: Unique identifier of the tool whose parameters are to be retrieved.
|
|
562
545
|
:param tool_public_name: Public name of the tool whose parameters are to be retrieved.
|
|
563
546
|
:param filter_settings: Settings to filter the parameter retrieval,
|
|
@@ -577,7 +560,7 @@ class AILabManager:
|
|
|
577
560
|
)
|
|
578
561
|
|
|
579
562
|
response_data = self.__tool_client.get_parameter(
|
|
580
|
-
project_id=project_id,
|
|
563
|
+
project_id=self.project_id,
|
|
581
564
|
tool_id=tool_id,
|
|
582
565
|
tool_public_name=tool_public_name,
|
|
583
566
|
revision=filter_settings.revision,
|
|
@@ -595,7 +578,6 @@ class AILabManager:
|
|
|
595
578
|
|
|
596
579
|
def set_parameter(
|
|
597
580
|
self,
|
|
598
|
-
project_id: str,
|
|
599
581
|
tool_id: Optional[str] = None,
|
|
600
582
|
tool_public_name: Optional[str] = None,
|
|
601
583
|
parameters: List[ToolParameter] = None
|
|
@@ -606,7 +588,6 @@ class AILabManager:
|
|
|
606
588
|
This method sends a request to the tool client to set parameters for a tool identified by
|
|
607
589
|
either `tool_id` or `tool_public_name`.
|
|
608
590
|
|
|
609
|
-
:param project_id: Unique identifier of the project.
|
|
610
591
|
:param tool_id: Unique identifier of the tool whose parameters are to be set.
|
|
611
592
|
:param tool_public_name: Public name of the tool whose parameters are to be set.
|
|
612
593
|
:param parameters: List of parameter objects defining the tool's parameters.
|
|
@@ -622,7 +603,7 @@ class AILabManager:
|
|
|
622
603
|
params_dict = [param.to_dict() for param in parameters]
|
|
623
604
|
|
|
624
605
|
response_data = self.__tool_client.set_parameter(
|
|
625
|
-
project_id=project_id,
|
|
606
|
+
project_id=self.project_id,
|
|
626
607
|
tool_id=tool_id,
|
|
627
608
|
tool_public_name=tool_public_name,
|
|
628
609
|
parameters=params_dict
|
|
@@ -678,7 +659,6 @@ class AILabManager:
|
|
|
678
659
|
|
|
679
660
|
def create_reasoning_strategy(
|
|
680
661
|
self,
|
|
681
|
-
project_id: str,
|
|
682
662
|
strategy: ReasoningStrategy,
|
|
683
663
|
automatic_publish: bool = False
|
|
684
664
|
) -> ReasoningStrategy:
|
|
@@ -688,7 +668,6 @@ class AILabManager:
|
|
|
688
668
|
This method sends a request to the reasoning strategy client to create a reasoning strategy
|
|
689
669
|
based on the attributes of the provided `ReasoningStrategy` object.
|
|
690
670
|
|
|
691
|
-
:param project_id: Unique identifier of the project where the reasoning strategy will be created.
|
|
692
671
|
:param strategy: The reasoning strategy configuration object containing name, system_prompt,
|
|
693
672
|
access_scope, type, and localized_descriptions.
|
|
694
673
|
:param automatic_publish: Whether to automatically publish the reasoning strategy after creation.
|
|
@@ -697,7 +676,7 @@ class AILabManager:
|
|
|
697
676
|
:raises APIError: If the API returns errors.
|
|
698
677
|
"""
|
|
699
678
|
response_data = self.__reasoning_strategy_client.create_reasoning_strategy(
|
|
700
|
-
project_id=project_id,
|
|
679
|
+
project_id=self.project_id,
|
|
701
680
|
name=strategy.name,
|
|
702
681
|
system_prompt=strategy.system_prompt,
|
|
703
682
|
access_scope=strategy.access_scope,
|
|
@@ -716,7 +695,6 @@ class AILabManager:
|
|
|
716
695
|
|
|
717
696
|
def update_reasoning_strategy(
|
|
718
697
|
self,
|
|
719
|
-
project_id: str,
|
|
720
698
|
strategy: ReasoningStrategy,
|
|
721
699
|
automatic_publish: bool = False,
|
|
722
700
|
upsert: bool = False
|
|
@@ -727,7 +705,6 @@ class AILabManager:
|
|
|
727
705
|
This method sends a request to the reasoning strategy client to update a reasoning strategy
|
|
728
706
|
identified by `strategy.id` based on the attributes of the provided `ReasoningStrategy` object.
|
|
729
707
|
|
|
730
|
-
:param project_id: Unique identifier of the project where the reasoning strategy resides.
|
|
731
708
|
:param strategy: The reasoning strategy configuration object containing updated details,
|
|
732
709
|
including id, name, system_prompt, access_scope, type, and localized_descriptions.
|
|
733
710
|
:param automatic_publish: Whether to automatically publish the reasoning strategy after updating.
|
|
@@ -738,7 +715,7 @@ class AILabManager:
|
|
|
738
715
|
:raises APIError: If the API returns errors.
|
|
739
716
|
"""
|
|
740
717
|
response_data = self.__reasoning_strategy_client.update_reasoning_strategy(
|
|
741
|
-
project_id=project_id,
|
|
718
|
+
project_id=self.project_id,
|
|
742
719
|
reasoning_strategy_id=strategy.id,
|
|
743
720
|
name=strategy.name,
|
|
744
721
|
system_prompt=strategy.system_prompt,
|
|
@@ -759,7 +736,6 @@ class AILabManager:
|
|
|
759
736
|
|
|
760
737
|
def get_reasoning_strategy(
|
|
761
738
|
self,
|
|
762
|
-
project_id: str,
|
|
763
739
|
reasoning_strategy_id: Optional[str] = None,
|
|
764
740
|
reasoning_strategy_name: Optional[str] = None
|
|
765
741
|
) -> ReasoningStrategy:
|
|
@@ -769,7 +745,6 @@ class AILabManager:
|
|
|
769
745
|
This method sends a request to the reasoning strategy client to retrieve a reasoning strategy
|
|
770
746
|
identified by either `reasoning_strategy_id` or `reasoning_strategy_name`.
|
|
771
747
|
|
|
772
|
-
:param project_id: Unique identifier of the project where the reasoning strategy resides.
|
|
773
748
|
:param reasoning_strategy_id: Unique identifier of the reasoning strategy to retrieve.
|
|
774
749
|
:param reasoning_strategy_name: Name of the reasoning strategy to retrieve.
|
|
775
750
|
:return: A `ReasoningStrategy` object representing the retrieved reasoning strategy.
|
|
@@ -780,7 +755,7 @@ class AILabManager:
|
|
|
780
755
|
raise MissingRequirementException("Either reasoning_strategy_id or reasoning_strategy_name must be provided.")
|
|
781
756
|
|
|
782
757
|
response_data = self.__reasoning_strategy_client.get_reasoning_strategy(
|
|
783
|
-
project_id=project_id,
|
|
758
|
+
project_id=self.project_id,
|
|
784
759
|
reasoning_strategy_id=reasoning_strategy_id,
|
|
785
760
|
reasoning_strategy_name=reasoning_strategy_name
|
|
786
761
|
)
|
|
@@ -795,7 +770,6 @@ class AILabManager:
|
|
|
795
770
|
|
|
796
771
|
def create_process(
|
|
797
772
|
self,
|
|
798
|
-
project_id: str,
|
|
799
773
|
process: AgenticProcess,
|
|
800
774
|
automatic_publish: bool = False
|
|
801
775
|
) -> AgenticProcess:
|
|
@@ -805,7 +779,6 @@ class AILabManager:
|
|
|
805
779
|
This method sends a request to the process client to create a process based on the attributes
|
|
806
780
|
of the provided `AgenticProcess` object.
|
|
807
781
|
|
|
808
|
-
:param project_id: Unique identifier of the project.
|
|
809
782
|
:param process: The process configuration to create, including key, name, description, kb,
|
|
810
783
|
agentic_activities, artifact_signals, user_signals, start_event, end_event, sequence_flows,
|
|
811
784
|
and variables.
|
|
@@ -814,7 +787,7 @@ class AILabManager:
|
|
|
814
787
|
:raises APIError: If the API returns errors.
|
|
815
788
|
"""
|
|
816
789
|
response_data = self.__process_client.create_process(
|
|
817
|
-
project_id=project_id,
|
|
790
|
+
project_id=self.project_id,
|
|
818
791
|
key=process.key,
|
|
819
792
|
name=process.name,
|
|
820
793
|
description=process.description,
|
|
@@ -839,7 +812,6 @@ class AILabManager:
|
|
|
839
812
|
|
|
840
813
|
def update_process(
|
|
841
814
|
self,
|
|
842
|
-
project_id: str,
|
|
843
815
|
process: AgenticProcess,
|
|
844
816
|
automatic_publish: bool = False,
|
|
845
817
|
upsert: bool = False
|
|
@@ -850,7 +822,6 @@ class AILabManager:
|
|
|
850
822
|
This method sends a request to the process client to update a process identified by `process.id`
|
|
851
823
|
based on the attributes of the provided `AgenticProcess` object.
|
|
852
824
|
|
|
853
|
-
:param project_id: Unique identifier of the project.
|
|
854
825
|
:param process: The process configuration to update, including id, key, name, description, kb,
|
|
855
826
|
agentic_activities, artifact_signals, user_signals, start_event, end_event, sequence_flows,
|
|
856
827
|
and variables.
|
|
@@ -860,7 +831,7 @@ class AILabManager:
|
|
|
860
831
|
:raises APIError: If the API returns errors.
|
|
861
832
|
"""
|
|
862
833
|
response_data = self.__process_client.update_process(
|
|
863
|
-
project_id=project_id,
|
|
834
|
+
project_id=self.project_id,
|
|
864
835
|
process_id=process.id,
|
|
865
836
|
name=process.name,
|
|
866
837
|
key=process.key,
|
|
@@ -887,7 +858,6 @@ class AILabManager:
|
|
|
887
858
|
|
|
888
859
|
def get_process(
|
|
889
860
|
self,
|
|
890
|
-
project_id: str,
|
|
891
861
|
process_id: Optional[str] = None,
|
|
892
862
|
process_name: Optional[str] = None,
|
|
893
863
|
filter_settings: Optional[FilterSettings] = None
|
|
@@ -899,7 +869,6 @@ class AILabManager:
|
|
|
899
869
|
`process_id` or `process_name`. Optional filter settings can specify revision, version, and
|
|
900
870
|
whether to allow drafts.
|
|
901
871
|
|
|
902
|
-
:param project_id: Unique identifier of the project.
|
|
903
872
|
:param process_id: Unique identifier of the process to retrieve.
|
|
904
873
|
:param process_name: Name of the process to retrieve.
|
|
905
874
|
:param filter_settings: Settings to filter the process retrieval (revision, version, allow_drafts).
|
|
@@ -912,7 +881,7 @@ class AILabManager:
|
|
|
912
881
|
|
|
913
882
|
filter_settings = filter_settings or FilterSettings(revision="0", version="0", allow_drafts=True)
|
|
914
883
|
response_data = self.__process_client.get_process(
|
|
915
|
-
project_id=project_id,
|
|
884
|
+
project_id=self.project_id,
|
|
916
885
|
process_id=process_id,
|
|
917
886
|
process_name=process_name,
|
|
918
887
|
revision=filter_settings.revision,
|
|
@@ -930,7 +899,6 @@ class AILabManager:
|
|
|
930
899
|
|
|
931
900
|
def list_processes(
|
|
932
901
|
self,
|
|
933
|
-
project_id: str,
|
|
934
902
|
filter_settings: Optional[FilterSettings] = None
|
|
935
903
|
) -> AgenticProcessList:
|
|
936
904
|
"""
|
|
@@ -939,14 +907,13 @@ class AILabManager:
|
|
|
939
907
|
This method queries the process client to fetch a list of processes for the given project ID,
|
|
940
908
|
applying the specified filter settings.
|
|
941
909
|
|
|
942
|
-
:param project_id: Unique identifier of the project.
|
|
943
910
|
:param filter_settings: Settings to filter the process list (id, name, status, start, count, allow_drafts).
|
|
944
911
|
:return: An `AgenticProcessList` object containing the retrieved processes.
|
|
945
912
|
:raises APIError: If the API returns errors.
|
|
946
913
|
"""
|
|
947
914
|
filter_settings = filter_settings or FilterSettings(start="0", count="100", allow_drafts=True)
|
|
948
915
|
response_data = self.__process_client.list_processes(
|
|
949
|
-
project_id=project_id,
|
|
916
|
+
project_id=self.project_id,
|
|
950
917
|
id=filter_settings.id,
|
|
951
918
|
name=filter_settings.name,
|
|
952
919
|
status=filter_settings.status,
|
|
@@ -965,7 +932,6 @@ class AILabManager:
|
|
|
965
932
|
|
|
966
933
|
def list_process_instances(
|
|
967
934
|
self,
|
|
968
|
-
project_id: str,
|
|
969
935
|
process_id: str,
|
|
970
936
|
filter_settings: Optional[FilterSettings] = None
|
|
971
937
|
) -> ProcessInstanceList:
|
|
@@ -975,7 +941,6 @@ class AILabManager:
|
|
|
975
941
|
This method queries the process client to fetch a list of process instances for the given
|
|
976
942
|
process ID, applying the specified filter settings.
|
|
977
943
|
|
|
978
|
-
:param project_id: Unique identifier of the project.
|
|
979
944
|
:param process_id: Unique identifier of the process to list instances for.
|
|
980
945
|
:param filter_settings: Settings to filter the instance list (is_active, start, count).
|
|
981
946
|
:return: A `ProcessInstanceList` object containing the retrieved process instances.
|
|
@@ -983,7 +948,7 @@ class AILabManager:
|
|
|
983
948
|
"""
|
|
984
949
|
filter_settings = filter_settings or FilterSettings(start="0", count="10", is_active=True)
|
|
985
950
|
response_data = self.__process_client.list_process_instances(
|
|
986
|
-
project_id=project_id,
|
|
951
|
+
project_id=self.project_id,
|
|
987
952
|
process_id=process_id,
|
|
988
953
|
is_active=filter_settings.is_active,
|
|
989
954
|
start=filter_settings.start,
|
|
@@ -1000,7 +965,6 @@ class AILabManager:
|
|
|
1000
965
|
|
|
1001
966
|
def delete_process(
|
|
1002
967
|
self,
|
|
1003
|
-
project_id: str,
|
|
1004
968
|
process_id: Optional[str] = None,
|
|
1005
969
|
process_name: Optional[str] = None
|
|
1006
970
|
) -> EmptyResponse:
|
|
@@ -1010,7 +974,6 @@ class AILabManager:
|
|
|
1010
974
|
This method sends a request to the process client to delete a process identified by either
|
|
1011
975
|
`process_id` or `process_name`.
|
|
1012
976
|
|
|
1013
|
-
:param project_id: Unique identifier of the project.
|
|
1014
977
|
:param process_id: Unique identifier of the process to delete.
|
|
1015
978
|
:param process_name: Name of the process to delete.
|
|
1016
979
|
:return: `EmptyResponse` if the process was deleted successfully.
|
|
@@ -1021,7 +984,7 @@ class AILabManager:
|
|
|
1021
984
|
raise MissingRequirementException("Either process_id or process_name must be provided.")
|
|
1022
985
|
|
|
1023
986
|
response_data = self.__process_client.delete_process(
|
|
1024
|
-
project_id=project_id,
|
|
987
|
+
project_id=self.project_id,
|
|
1025
988
|
process_id=process_id,
|
|
1026
989
|
process_name=process_name
|
|
1027
990
|
)
|
|
@@ -1036,7 +999,6 @@ class AILabManager:
|
|
|
1036
999
|
|
|
1037
1000
|
def publish_process_revision(
|
|
1038
1001
|
self,
|
|
1039
|
-
project_id: str,
|
|
1040
1002
|
process_id: Optional[str] = None,
|
|
1041
1003
|
process_name: Optional[str] = None,
|
|
1042
1004
|
revision: str = None
|
|
@@ -1047,7 +1009,6 @@ class AILabManager:
|
|
|
1047
1009
|
This method sends a request to the process client to publish the specified revision of the
|
|
1048
1010
|
process identified by either `process_id` or `process_name`.
|
|
1049
1011
|
|
|
1050
|
-
:param project_id: Unique identifier of the project.
|
|
1051
1012
|
:param process_id: Unique identifier of the process to publish.
|
|
1052
1013
|
:param process_name: Name of the process to publish.
|
|
1053
1014
|
:param revision: Revision of the process to publish.
|
|
@@ -1059,7 +1020,7 @@ class AILabManager:
|
|
|
1059
1020
|
raise MissingRequirementException("Either process_id or process_name and revision must be provided.")
|
|
1060
1021
|
|
|
1061
1022
|
response_data = self.__process_client.publish_process_revision(
|
|
1062
|
-
project_id=project_id,
|
|
1023
|
+
project_id=self.project_id,
|
|
1063
1024
|
process_id=process_id,
|
|
1064
1025
|
process_name=process_name,
|
|
1065
1026
|
revision=revision
|
|
@@ -1075,7 +1036,6 @@ class AILabManager:
|
|
|
1075
1036
|
|
|
1076
1037
|
def create_task(
|
|
1077
1038
|
self,
|
|
1078
|
-
project_id: str,
|
|
1079
1039
|
task: Task,
|
|
1080
1040
|
automatic_publish: bool = False
|
|
1081
1041
|
) -> Task:
|
|
@@ -1085,7 +1045,6 @@ class AILabManager:
|
|
|
1085
1045
|
This method sends a request to the process client to create a task based on the attributes
|
|
1086
1046
|
of the provided `Task` object.
|
|
1087
1047
|
|
|
1088
|
-
:param project_id: Unique identifier of the project where the task will be created.
|
|
1089
1048
|
:param task: The task configuration to create, including name (required), description,
|
|
1090
1049
|
title_template, id, prompt_data, and artifact_types. Optional fields are included if set.
|
|
1091
1050
|
:param automatic_publish: Whether to publish the task after creation. Defaults to False.
|
|
@@ -1093,7 +1052,7 @@ class AILabManager:
|
|
|
1093
1052
|
:raises APIError: If the API returns errors.
|
|
1094
1053
|
"""
|
|
1095
1054
|
response_data = self.__process_client.create_task(
|
|
1096
|
-
project_id=project_id,
|
|
1055
|
+
project_id=self.project_id,
|
|
1097
1056
|
name=task.name,
|
|
1098
1057
|
description=task.description,
|
|
1099
1058
|
title_template=task.title_template,
|
|
@@ -1113,7 +1072,6 @@ class AILabManager:
|
|
|
1113
1072
|
|
|
1114
1073
|
def get_task(
|
|
1115
1074
|
self,
|
|
1116
|
-
project_id: str,
|
|
1117
1075
|
task_id: Optional[str] = None,
|
|
1118
1076
|
task_name: Optional[str] = None
|
|
1119
1077
|
) -> Task:
|
|
@@ -1123,7 +1081,6 @@ class AILabManager:
|
|
|
1123
1081
|
This method sends a request to the process client to retrieve a task identified by either
|
|
1124
1082
|
`task_id` or `task_name`.
|
|
1125
1083
|
|
|
1126
|
-
:param project_id: Unique identifier of the project.
|
|
1127
1084
|
:param task_id: Unique identifier of the task to retrieve.
|
|
1128
1085
|
:param task_name: Name of the task to retrieve.
|
|
1129
1086
|
:return: A `Task` object representing the retrieved task.
|
|
@@ -1134,7 +1091,7 @@ class AILabManager:
|
|
|
1134
1091
|
raise MissingRequirementException("Either task_id or task_name must be provided.")
|
|
1135
1092
|
|
|
1136
1093
|
response_data = self.__process_client.get_task(
|
|
1137
|
-
project_id=project_id,
|
|
1094
|
+
project_id=self.project_id,
|
|
1138
1095
|
task_id=task_id,
|
|
1139
1096
|
task_name=task_name
|
|
1140
1097
|
)
|
|
@@ -1149,7 +1106,6 @@ class AILabManager:
|
|
|
1149
1106
|
|
|
1150
1107
|
def list_tasks(
|
|
1151
1108
|
self,
|
|
1152
|
-
project_id: str,
|
|
1153
1109
|
filter_settings: Optional[FilterSettings] = None
|
|
1154
1110
|
) -> TaskList:
|
|
1155
1111
|
"""
|
|
@@ -1158,14 +1114,13 @@ class AILabManager:
|
|
|
1158
1114
|
This method queries the process client to fetch a list of tasks for the given project ID,
|
|
1159
1115
|
applying the specified filter settings.
|
|
1160
1116
|
|
|
1161
|
-
:param project_id: Unique identifier of the project.
|
|
1162
1117
|
:param filter_settings: Settings to filter the task list (id, start, count, allow_drafts).
|
|
1163
1118
|
:return: A `TaskList` object containing the retrieved tasks.
|
|
1164
1119
|
:raises APIError: If the API returns errors.
|
|
1165
1120
|
"""
|
|
1166
1121
|
filter_settings = filter_settings or FilterSettings(start="0", count="100", allow_drafts=True)
|
|
1167
1122
|
response_data = self.__process_client.list_tasks(
|
|
1168
|
-
project_id=project_id,
|
|
1123
|
+
project_id=self.project_id,
|
|
1169
1124
|
id=filter_settings.id,
|
|
1170
1125
|
start=filter_settings.start,
|
|
1171
1126
|
count=filter_settings.count,
|
|
@@ -1182,7 +1137,6 @@ class AILabManager:
|
|
|
1182
1137
|
|
|
1183
1138
|
def update_task(
|
|
1184
1139
|
self,
|
|
1185
|
-
project_id: str,
|
|
1186
1140
|
task: Task,
|
|
1187
1141
|
automatic_publish: bool = False,
|
|
1188
1142
|
upsert: bool = False
|
|
@@ -1193,7 +1147,6 @@ class AILabManager:
|
|
|
1193
1147
|
This method sends a request to the process client to update a task identified by `task.id`
|
|
1194
1148
|
based on the attributes of the provided `Task` object.
|
|
1195
1149
|
|
|
1196
|
-
:param project_id: Unique identifier of the project where the task resides.
|
|
1197
1150
|
:param task: The task configuration to update, including id (required), name, description,
|
|
1198
1151
|
title_template, prompt_data, and artifact_types. Optional fields are included if set.
|
|
1199
1152
|
:param automatic_publish: Whether to publish the task after updating. Defaults to False.
|
|
@@ -1206,7 +1159,7 @@ class AILabManager:
|
|
|
1206
1159
|
raise MissingRequirementException("Task ID must be provided for update.")
|
|
1207
1160
|
|
|
1208
1161
|
response_data = self.__process_client.update_task(
|
|
1209
|
-
project_id=project_id,
|
|
1162
|
+
project_id=self.project_id,
|
|
1210
1163
|
task_id=task.id,
|
|
1211
1164
|
name=task.name,
|
|
1212
1165
|
description=task.description,
|
|
@@ -1228,7 +1181,6 @@ class AILabManager:
|
|
|
1228
1181
|
|
|
1229
1182
|
def delete_task(
|
|
1230
1183
|
self,
|
|
1231
|
-
project_id: str,
|
|
1232
1184
|
task_id: Optional[str] = None,
|
|
1233
1185
|
task_name: Optional[str] = None
|
|
1234
1186
|
) -> EmptyResponse:
|
|
@@ -1238,7 +1190,6 @@ class AILabManager:
|
|
|
1238
1190
|
This method sends a request to the process client to delete a task identified by either
|
|
1239
1191
|
`task_id` or `task_name`.
|
|
1240
1192
|
|
|
1241
|
-
:param project_id: Unique identifier of the project.
|
|
1242
1193
|
:param task_id: Unique identifier of the task to delete.
|
|
1243
1194
|
:param task_name: Name of the task to delete.
|
|
1244
1195
|
:return: `EmptyResponse` if the task was deleted successfully.
|
|
@@ -1249,7 +1200,7 @@ class AILabManager:
|
|
|
1249
1200
|
raise MissingRequirementException("Either task_id or task_name must be provided.")
|
|
1250
1201
|
|
|
1251
1202
|
response_data = self.__process_client.delete_task(
|
|
1252
|
-
project_id=project_id,
|
|
1203
|
+
project_id=self.project_id,
|
|
1253
1204
|
task_id=task_id,
|
|
1254
1205
|
task_name=task_name
|
|
1255
1206
|
)
|
|
@@ -1264,7 +1215,6 @@ class AILabManager:
|
|
|
1264
1215
|
|
|
1265
1216
|
def publish_task_revision(
|
|
1266
1217
|
self,
|
|
1267
|
-
project_id: str,
|
|
1268
1218
|
task_id: Optional[str] = None,
|
|
1269
1219
|
task_name: Optional[str] = None,
|
|
1270
1220
|
revision: str = None
|
|
@@ -1275,7 +1225,6 @@ class AILabManager:
|
|
|
1275
1225
|
This method sends a request to the process client to publish the specified revision of the
|
|
1276
1226
|
task identified by either `task_id` or `task_name`.
|
|
1277
1227
|
|
|
1278
|
-
:param project_id: Unique identifier of the project.
|
|
1279
1228
|
:param task_id: Unique identifier of the task to publish.
|
|
1280
1229
|
:param task_name: Name of the task to publish.
|
|
1281
1230
|
:param revision: Revision of the task to publish.
|
|
@@ -1287,7 +1236,7 @@ class AILabManager:
|
|
|
1287
1236
|
raise MissingRequirementException("Either task_id or task_name and revision must be provided.")
|
|
1288
1237
|
|
|
1289
1238
|
response_data = self.__process_client.publish_task_revision(
|
|
1290
|
-
project_id=project_id,
|
|
1239
|
+
project_id=self.project_id,
|
|
1291
1240
|
task_id=task_id,
|
|
1292
1241
|
task_name=task_name,
|
|
1293
1242
|
revision=revision
|
|
@@ -1303,7 +1252,6 @@ class AILabManager:
|
|
|
1303
1252
|
|
|
1304
1253
|
def start_instance(
|
|
1305
1254
|
self,
|
|
1306
|
-
project_id: str,
|
|
1307
1255
|
process_name: str,
|
|
1308
1256
|
subject: Optional[str] = None,
|
|
1309
1257
|
variables: Optional[Union[List[Variable], VariableList]] = None
|
|
@@ -1314,7 +1262,6 @@ class AILabManager:
|
|
|
1314
1262
|
This method sends a request to the process client to start a new process instance for the
|
|
1315
1263
|
specified `process_name`.
|
|
1316
1264
|
|
|
1317
|
-
:param project_id: Unique identifier of the project.
|
|
1318
1265
|
:param process_name: Name of the process to start an instance for.
|
|
1319
1266
|
:param subject: Subject of the process instance. Defaults to None.
|
|
1320
1267
|
:param variables: List of variables for the instance. Defaults to None.
|
|
@@ -1325,7 +1272,7 @@ class AILabManager:
|
|
|
1325
1272
|
variables = VariableList(variables=variables)
|
|
1326
1273
|
|
|
1327
1274
|
response_data = self.__process_client.start_instance(
|
|
1328
|
-
project_id=project_id,
|
|
1275
|
+
project_id=self.project_id,
|
|
1329
1276
|
process_name=process_name,
|
|
1330
1277
|
subject=subject,
|
|
1331
1278
|
variables=variables.to_dict()
|
|
@@ -1341,7 +1288,6 @@ class AILabManager:
|
|
|
1341
1288
|
|
|
1342
1289
|
def abort_instance(
|
|
1343
1290
|
self,
|
|
1344
|
-
project_id: str,
|
|
1345
1291
|
instance_id: str
|
|
1346
1292
|
) -> EmptyResponse:
|
|
1347
1293
|
"""
|
|
@@ -1350,7 +1296,6 @@ class AILabManager:
|
|
|
1350
1296
|
This method sends a request to the process client to abort a process instance identified
|
|
1351
1297
|
by `instance_id`.
|
|
1352
1298
|
|
|
1353
|
-
:param project_id: Unique identifier of the project.
|
|
1354
1299
|
:param instance_id: Unique identifier of the instance to abort.
|
|
1355
1300
|
:return: `EmptyResponse` if the instance was aborted successfully.
|
|
1356
1301
|
:raises MissingRequirementException: If instance_id is not provided.
|
|
@@ -1360,7 +1305,7 @@ class AILabManager:
|
|
|
1360
1305
|
raise MissingRequirementException("Instance ID must be provided.")
|
|
1361
1306
|
|
|
1362
1307
|
response_data = self.__process_client.abort_instance(
|
|
1363
|
-
project_id=project_id,
|
|
1308
|
+
project_id=self.project_id,
|
|
1364
1309
|
instance_id=instance_id
|
|
1365
1310
|
)
|
|
1366
1311
|
|
|
@@ -1374,7 +1319,6 @@ class AILabManager:
|
|
|
1374
1319
|
|
|
1375
1320
|
def get_instance(
|
|
1376
1321
|
self,
|
|
1377
|
-
project_id: str,
|
|
1378
1322
|
instance_id: str
|
|
1379
1323
|
) -> ProcessInstance:
|
|
1380
1324
|
"""
|
|
@@ -1383,7 +1327,6 @@ class AILabManager:
|
|
|
1383
1327
|
This method sends a request to the process client to retrieve a process instance identified
|
|
1384
1328
|
by `instance_id`.
|
|
1385
1329
|
|
|
1386
|
-
:param project_id: Unique identifier of the project.
|
|
1387
1330
|
:param instance_id: Unique identifier of the instance to retrieve.
|
|
1388
1331
|
:return: A `ProcessInstance` object representing the retrieved instance.
|
|
1389
1332
|
:raises MissingRequirementException: If instance_id is not provided.
|
|
@@ -1393,7 +1336,7 @@ class AILabManager:
|
|
|
1393
1336
|
raise MissingRequirementException("Instance ID must be provided.")
|
|
1394
1337
|
|
|
1395
1338
|
response_data = self.__process_client.get_instance(
|
|
1396
|
-
project_id=project_id,
|
|
1339
|
+
project_id=self.project_id,
|
|
1397
1340
|
instance_id=instance_id
|
|
1398
1341
|
)
|
|
1399
1342
|
if ErrorHandler.has_errors(response_data):
|
|
@@ -1406,7 +1349,6 @@ class AILabManager:
|
|
|
1406
1349
|
|
|
1407
1350
|
def get_instance_history(
|
|
1408
1351
|
self,
|
|
1409
|
-
project_id: str,
|
|
1410
1352
|
instance_id: str
|
|
1411
1353
|
) -> dict:
|
|
1412
1354
|
"""
|
|
@@ -1415,7 +1357,6 @@ class AILabManager:
|
|
|
1415
1357
|
This method sends a request to the process client to retrieve the history of a process instance
|
|
1416
1358
|
identified by `instance_id`.
|
|
1417
1359
|
|
|
1418
|
-
:param project_id: Unique identifier of the project.
|
|
1419
1360
|
:param instance_id: Unique identifier of the instance to retrieve history for.
|
|
1420
1361
|
:return: A dictionary containing the instance history.
|
|
1421
1362
|
:raises MissingRequirementException: If instance_id is not provided.
|
|
@@ -1425,7 +1366,7 @@ class AILabManager:
|
|
|
1425
1366
|
raise MissingRequirementException("Instance ID must be provided.")
|
|
1426
1367
|
|
|
1427
1368
|
response_data = self.__process_client.get_instance_history(
|
|
1428
|
-
project_id=project_id,
|
|
1369
|
+
project_id=self.project_id,
|
|
1429
1370
|
instance_id=instance_id
|
|
1430
1371
|
)
|
|
1431
1372
|
|
|
@@ -1439,7 +1380,6 @@ class AILabManager:
|
|
|
1439
1380
|
|
|
1440
1381
|
def get_thread_information(
|
|
1441
1382
|
self,
|
|
1442
|
-
project_id: str,
|
|
1443
1383
|
thread_id: str
|
|
1444
1384
|
) -> dict:
|
|
1445
1385
|
"""
|
|
@@ -1448,7 +1388,6 @@ class AILabManager:
|
|
|
1448
1388
|
This method sends a request to the process client to retrieve information about a thread
|
|
1449
1389
|
identified by `thread_id`.
|
|
1450
1390
|
|
|
1451
|
-
:param project_id: Unique identifier of the project.
|
|
1452
1391
|
:param thread_id: Unique identifier of the thread to retrieve information for.
|
|
1453
1392
|
:return: A dictionary containing the thread information.
|
|
1454
1393
|
:raises MissingRequirementException: If thread_id is not provided.
|
|
@@ -1458,7 +1397,7 @@ class AILabManager:
|
|
|
1458
1397
|
raise MissingRequirementException("Thread ID must be provided.")
|
|
1459
1398
|
|
|
1460
1399
|
response_data = self.__process_client.get_thread_information(
|
|
1461
|
-
project_id=project_id,
|
|
1400
|
+
project_id=self.project_id,
|
|
1462
1401
|
thread_id=thread_id
|
|
1463
1402
|
)
|
|
1464
1403
|
|
|
@@ -1472,7 +1411,6 @@ class AILabManager:
|
|
|
1472
1411
|
|
|
1473
1412
|
def send_user_signal(
|
|
1474
1413
|
self,
|
|
1475
|
-
project_id: str,
|
|
1476
1414
|
instance_id: str,
|
|
1477
1415
|
signal_name: str
|
|
1478
1416
|
) -> EmptyResponse:
|
|
@@ -1482,7 +1420,6 @@ class AILabManager:
|
|
|
1482
1420
|
This method sends a request to the process client to send a user signal identified by
|
|
1483
1421
|
`signal_name` to a process instance identified by `instance_id`.
|
|
1484
1422
|
|
|
1485
|
-
:param project_id: Unique identifier of the project.
|
|
1486
1423
|
:param instance_id: Unique identifier of the instance to send the signal to.
|
|
1487
1424
|
:param signal_name: Name of the user signal to send.
|
|
1488
1425
|
:return: `EmptyResponse` if the signal was sent successfully.
|
|
@@ -1493,7 +1430,7 @@ class AILabManager:
|
|
|
1493
1430
|
raise MissingRequirementException("Instance ID and signal name must be provided.")
|
|
1494
1431
|
|
|
1495
1432
|
response_data = self.__process_client.send_user_signal(
|
|
1496
|
-
project_id=project_id,
|
|
1433
|
+
project_id=self.project_id,
|
|
1497
1434
|
instance_id=instance_id,
|
|
1498
1435
|
signal_name=signal_name
|
|
1499
1436
|
)
|
|
@@ -1508,7 +1445,6 @@ class AILabManager:
|
|
|
1508
1445
|
|
|
1509
1446
|
def create_knowledge_base(
|
|
1510
1447
|
self,
|
|
1511
|
-
project_id: str,
|
|
1512
1448
|
knowledge_base: KnowledgeBase,
|
|
1513
1449
|
) -> KnowledgeBase:
|
|
1514
1450
|
"""
|
|
@@ -1517,14 +1453,13 @@ class AILabManager:
|
|
|
1517
1453
|
This method sends a request to the process client to create a knowledge base based on
|
|
1518
1454
|
the attributes of the provided `KnowledgeBase` object.
|
|
1519
1455
|
|
|
1520
|
-
:param project_id: Unique identifier of the project where the knowledge base will be created.
|
|
1521
1456
|
:param knowledge_base: The knowledge base configuration object containing name
|
|
1522
1457
|
and artifact type names.
|
|
1523
1458
|
:return: A `KnowledgeBase` object representing the created knowledge base.
|
|
1524
1459
|
:raises APIError: If the API returns errors.
|
|
1525
1460
|
"""
|
|
1526
1461
|
response_data = self.__process_client.create_kb(
|
|
1527
|
-
project_id=project_id,
|
|
1462
|
+
project_id=self.project_id,
|
|
1528
1463
|
name=knowledge_base.name,
|
|
1529
1464
|
artifacts=knowledge_base.artifacts if knowledge_base.artifacts else None,
|
|
1530
1465
|
metadata=knowledge_base.metadata if knowledge_base.metadata else None
|
|
@@ -1539,7 +1474,6 @@ class AILabManager:
|
|
|
1539
1474
|
|
|
1540
1475
|
def list_knowledge_bases(
|
|
1541
1476
|
self,
|
|
1542
|
-
project_id: str,
|
|
1543
1477
|
name: Optional[str] = None,
|
|
1544
1478
|
start: Optional[int] = 0,
|
|
1545
1479
|
count: Optional[int] = 10
|
|
@@ -1550,7 +1484,6 @@ class AILabManager:
|
|
|
1550
1484
|
This method queries the process client to fetch a list of knowledge bases associated
|
|
1551
1485
|
with the specified project ID, applying optional filters for name and pagination.
|
|
1552
1486
|
|
|
1553
|
-
:param project_id: Unique identifier of the project to retrieve knowledge bases for.
|
|
1554
1487
|
:param name: Name filter to narrow down the list of knowledge bases.
|
|
1555
1488
|
:param start: Starting index for pagination, defaults to 0.
|
|
1556
1489
|
:param count: Number of knowledge bases to return, defaults to 10.
|
|
@@ -1558,7 +1491,7 @@ class AILabManager:
|
|
|
1558
1491
|
:raises APIError: If the API returns errors.
|
|
1559
1492
|
"""
|
|
1560
1493
|
response_data = self.__process_client.list_kbs(
|
|
1561
|
-
project_id=project_id,
|
|
1494
|
+
project_id=self.project_id,
|
|
1562
1495
|
name=name,
|
|
1563
1496
|
start=start,
|
|
1564
1497
|
count=count
|
|
@@ -1573,7 +1506,6 @@ class AILabManager:
|
|
|
1573
1506
|
|
|
1574
1507
|
def get_knowledge_base(
|
|
1575
1508
|
self,
|
|
1576
|
-
project_id: str,
|
|
1577
1509
|
kb_name: Optional[str] = None,
|
|
1578
1510
|
kb_id: Optional[str] = None
|
|
1579
1511
|
) -> KnowledgeBase:
|
|
@@ -1583,7 +1515,6 @@ class AILabManager:
|
|
|
1583
1515
|
This method sends a request to the process client to retrieve a knowledge base
|
|
1584
1516
|
identified by either `kb_name` or `kb_id`.
|
|
1585
1517
|
|
|
1586
|
-
:param project_id: Unique identifier of the project where the knowledge base resides.
|
|
1587
1518
|
:param kb_name: Name of the knowledge base to retrieve.
|
|
1588
1519
|
:param kb_id: Unique identifier of the knowledge base to retrieve.
|
|
1589
1520
|
:return: A `KnowledgeBase` object representing the retrieved knowledge base.
|
|
@@ -1594,7 +1525,7 @@ class AILabManager:
|
|
|
1594
1525
|
raise MissingRequirementException("Either kb_name or kb_id must be provided.")
|
|
1595
1526
|
|
|
1596
1527
|
response_data = self.__process_client.get_kb(
|
|
1597
|
-
project_id=project_id,
|
|
1528
|
+
project_id=self.project_id,
|
|
1598
1529
|
kb_name=kb_name,
|
|
1599
1530
|
kb_id=kb_id
|
|
1600
1531
|
)
|
|
@@ -1608,7 +1539,6 @@ class AILabManager:
|
|
|
1608
1539
|
|
|
1609
1540
|
def delete_knowledge_base(
|
|
1610
1541
|
self,
|
|
1611
|
-
project_id: str,
|
|
1612
1542
|
kb_name: Optional[str] = None,
|
|
1613
1543
|
kb_id: Optional[str] = None
|
|
1614
1544
|
) -> EmptyResponse:
|
|
@@ -1618,7 +1548,6 @@ class AILabManager:
|
|
|
1618
1548
|
This method sends a request to the process client to delete a knowledge base
|
|
1619
1549
|
identified by either `kb_name` or `kb_id`.
|
|
1620
1550
|
|
|
1621
|
-
:param project_id: Unique identifier of the project where the knowledge base resides.
|
|
1622
1551
|
:param kb_name: Name of the knowledge base to delete.
|
|
1623
1552
|
:param kb_id: Unique identifier of the knowledge base to delete.
|
|
1624
1553
|
:return: `EmptyResponse` if the knowledge base was deleted successfully.
|
|
@@ -1629,7 +1558,7 @@ class AILabManager:
|
|
|
1629
1558
|
raise MissingRequirementException("Either kb_name or kb_id must be provided.")
|
|
1630
1559
|
|
|
1631
1560
|
response_data = self.__process_client.delete_kb(
|
|
1632
|
-
project_id=project_id,
|
|
1561
|
+
project_id=self.project_id,
|
|
1633
1562
|
kb_name=kb_name,
|
|
1634
1563
|
kb_id=kb_id
|
|
1635
1564
|
)
|
|
@@ -1644,7 +1573,6 @@ class AILabManager:
|
|
|
1644
1573
|
|
|
1645
1574
|
def list_jobs(
|
|
1646
1575
|
self,
|
|
1647
|
-
project_id: str,
|
|
1648
1576
|
filter_settings: Optional[FilterSettings] = None,
|
|
1649
1577
|
topic: Optional[str] = None,
|
|
1650
1578
|
token: Optional[str] = None
|
|
@@ -1655,7 +1583,6 @@ class AILabManager:
|
|
|
1655
1583
|
This method queries the process client to fetch a list of jobs associated with the specified
|
|
1656
1584
|
project ID, applying optional filter settings.
|
|
1657
1585
|
|
|
1658
|
-
:param project_id: Unique identifier of the project.
|
|
1659
1586
|
:param filter_settings: Settings to filter the job list (start, count).
|
|
1660
1587
|
:param topic: Topic to filter the jobs (e.g., 'Default', 'Event'). Defaults to None.
|
|
1661
1588
|
:param token: Unique token identifier to filter a specific job. Defaults to None.
|
|
@@ -1663,12 +1590,10 @@ class AILabManager:
|
|
|
1663
1590
|
:raises MissingRequirementException: If project_id is not provided.
|
|
1664
1591
|
:raises APIError: If the API returns errors.
|
|
1665
1592
|
"""
|
|
1666
|
-
if not project_id:
|
|
1667
|
-
raise MissingRequirementException("Project ID must be provided.")
|
|
1668
1593
|
|
|
1669
1594
|
filter_settings = filter_settings or FilterSettings(start="0", count="100")
|
|
1670
1595
|
response_data = self.__process_client.list_jobs(
|
|
1671
|
-
project_id=project_id,
|
|
1596
|
+
project_id=self.project_id,
|
|
1672
1597
|
start=filter_settings.start,
|
|
1673
1598
|
count=filter_settings.count,
|
|
1674
1599
|
topic=topic,
|