pygeai 0.6.0b14__py3-none-any.whl → 0.7.0b1__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/__init__.py +1 -2
- pygeai/_docs/source/content/api_reference/project.rst +392 -0
- pygeai/_docs/source/content/authentication.rst +130 -1
- pygeai/_docs/source/content/debugger.rst +327 -157
- pygeai/_docs/source/pygeai.core.common.rst +8 -0
- pygeai/_docs/source/pygeai.tests.auth.rst +56 -0
- pygeai/_docs/source/pygeai.tests.cli.rst +8 -0
- pygeai/admin/clients.py +1 -3
- pygeai/analytics/clients.py +1 -1
- pygeai/assistant/clients.py +2 -7
- pygeai/assistant/data/clients.py +0 -8
- pygeai/assistant/data_analyst/clients.py +0 -2
- pygeai/assistant/managers.py +1 -1
- pygeai/assistant/rag/clients.py +0 -2
- pygeai/assistant/rag/mappers.py +9 -11
- pygeai/auth/clients.py +26 -7
- pygeai/auth/endpoints.py +2 -1
- pygeai/chat/clients.py +2 -2
- pygeai/chat/managers.py +1 -1
- pygeai/cli/commands/admin.py +13 -25
- pygeai/cli/commands/analytics.py +31 -71
- pygeai/cli/commands/assistant.py +84 -138
- pygeai/cli/commands/auth.py +23 -46
- pygeai/cli/commands/base.py +0 -1
- pygeai/cli/commands/chat.py +218 -209
- pygeai/cli/commands/common.py +5 -5
- pygeai/cli/commands/configuration.py +79 -29
- pygeai/cli/commands/docs.py +3 -4
- pygeai/cli/commands/embeddings.py +13 -19
- pygeai/cli/commands/evaluation.py +133 -344
- pygeai/cli/commands/feedback.py +7 -15
- pygeai/cli/commands/files.py +26 -53
- pygeai/cli/commands/gam.py +28 -69
- pygeai/cli/commands/lab/ai_lab.py +96 -142
- pygeai/cli/commands/lab/common.py +1 -1
- pygeai/cli/commands/lab/spec.py +12 -32
- pygeai/cli/commands/llm.py +9 -18
- pygeai/cli/commands/migrate.py +43 -99
- pygeai/cli/commands/organization.py +223 -196
- pygeai/cli/commands/rag.py +35 -58
- pygeai/cli/commands/rerank.py +21 -25
- pygeai/cli/commands/secrets.py +39 -67
- pygeai/cli/commands/usage_limits.py +50 -136
- pygeai/cli/commands/validators.py +1 -1
- pygeai/cli/geai.py +32 -3
- pygeai/cli/geai_proxy.py +6 -2
- pygeai/cli/install_man.py +1 -1
- pygeai/cli/parsers.py +1 -1
- pygeai/core/base/clients.py +90 -21
- pygeai/core/base/mappers.py +39 -55
- pygeai/core/base/session.py +129 -18
- pygeai/core/common/config.py +50 -13
- pygeai/core/common/constants.py +8 -0
- pygeai/core/common/exceptions.py +6 -0
- pygeai/core/embeddings/clients.py +0 -1
- pygeai/core/embeddings/managers.py +0 -1
- pygeai/core/feedback/clients.py +0 -2
- pygeai/core/feedback/models.py +1 -1
- pygeai/core/files/clients.py +0 -3
- pygeai/core/files/managers.py +1 -1
- pygeai/core/files/mappers.py +4 -5
- pygeai/core/llm/clients.py +0 -1
- pygeai/core/models.py +4 -4
- pygeai/core/plugins/clients.py +0 -3
- pygeai/core/plugins/models.py +2 -2
- pygeai/core/rerank/clients.py +0 -2
- pygeai/core/secrets/clients.py +0 -2
- pygeai/core/services/rest.py +80 -14
- pygeai/core/singleton.py +24 -0
- pygeai/dbg/__init__.py +2 -2
- pygeai/dbg/debugger.py +276 -38
- pygeai/evaluation/clients.py +2 -4
- pygeai/evaluation/dataset/clients.py +0 -1
- pygeai/evaluation/plan/clients.py +0 -2
- pygeai/evaluation/result/clients.py +0 -2
- pygeai/gam/clients.py +1 -3
- pygeai/health/clients.py +1 -3
- pygeai/lab/clients.py +0 -1
- pygeai/lab/managers.py +0 -1
- pygeai/lab/models.py +0 -1
- pygeai/lab/strategies/clients.py +1 -2
- pygeai/lab/tools/clients.py +2 -2
- pygeai/lab/tools/mappers.py +1 -1
- pygeai/migration/strategies.py +5 -6
- pygeai/migration/tools.py +1 -1
- pygeai/organization/clients.py +118 -12
- pygeai/organization/endpoints.py +1 -0
- pygeai/organization/limits/clients.py +4 -6
- pygeai/organization/limits/managers.py +1 -4
- pygeai/organization/managers.py +2 -2
- pygeai/proxy/config.py +1 -0
- pygeai/proxy/managers.py +6 -5
- pygeai/tests/admin/test_clients.py +11 -11
- pygeai/tests/assistants/rag/test_clients.py +1 -1
- pygeai/tests/assistants/rag/test_models.py +1 -2
- pygeai/tests/assistants/test_clients.py +1 -1
- pygeai/tests/assistants/test_managers.py +1 -3
- pygeai/tests/auth/test_cli_configuration.py +252 -0
- pygeai/tests/auth/test_client_initialization.py +411 -0
- pygeai/tests/auth/test_clients.py +29 -27
- pygeai/tests/auth/test_config_manager.py +305 -0
- pygeai/tests/auth/test_header_injection.py +294 -0
- pygeai/tests/auth/test_oauth.py +3 -1
- pygeai/tests/auth/test_session_logging.py +119 -0
- pygeai/tests/auth/test_session_validation.py +408 -0
- pygeai/tests/auth/test_singleton_reset.py +201 -0
- pygeai/tests/chat/test_clients.py +1 -1
- pygeai/tests/chat/test_iris.py +1 -1
- pygeai/tests/chat/test_ui.py +0 -2
- pygeai/tests/cli/commands/lab/test_ai_lab.py +1 -3
- pygeai/tests/cli/commands/lab/test_common.py +0 -1
- pygeai/tests/cli/commands/test_chat.py +1 -1
- pygeai/tests/cli/commands/test_common.py +0 -1
- pygeai/tests/cli/commands/test_embeddings.py +2 -2
- pygeai/tests/cli/commands/test_evaluation.py +1 -9
- pygeai/tests/cli/commands/test_llm.py +1 -1
- pygeai/tests/cli/commands/test_migrate.py +1 -1
- pygeai/tests/cli/commands/test_rerank.py +0 -1
- pygeai/tests/cli/commands/test_secrets.py +1 -1
- pygeai/tests/cli/commands/test_show_help.py +0 -1
- pygeai/tests/cli/commands/test_validators.py +0 -1
- pygeai/tests/cli/test_credentials_flag.py +312 -0
- pygeai/tests/cli/test_error_handler.py +0 -1
- pygeai/tests/core/base/test_mappers.py +2 -2
- pygeai/tests/core/base/test_models.py +4 -4
- pygeai/tests/core/common/test_config.py +2 -7
- pygeai/tests/core/common/test_decorators.py +0 -1
- pygeai/tests/core/embeddings/test_managers.py +1 -1
- pygeai/tests/core/feedback/test_clients.py +2 -2
- pygeai/tests/core/files/test_clients.py +6 -6
- pygeai/tests/core/files/test_models.py +0 -1
- pygeai/tests/core/files/test_responses.py +0 -1
- pygeai/tests/core/llm/test_clients.py +1 -1
- pygeai/tests/core/plugins/test_clients.py +4 -4
- pygeai/tests/core/rerank/test_mappers.py +1 -3
- pygeai/tests/core/secrets/test_clients.py +2 -3
- pygeai/tests/core/services/test_rest.py +10 -10
- pygeai/tests/core/utils/test_console.py +0 -1
- pygeai/tests/dbg/test_debugger.py +95 -8
- pygeai/tests/evaluation/dataset/test_clients.py +24 -27
- pygeai/tests/evaluation/plan/test_clients.py +16 -18
- pygeai/tests/evaluation/result/test_clients.py +4 -5
- pygeai/tests/health/test_clients.py +2 -2
- pygeai/tests/integration/lab/agents/test_create_agent.py +1 -3
- pygeai/tests/integration/lab/agents/test_get_agent.py +1 -1
- pygeai/tests/integration/lab/processes/test_create_process.py +2 -2
- pygeai/tests/integration/lab/processes/test_create_task.py +2 -3
- pygeai/tests/integration/lab/processes/test_delete_process.py +0 -1
- pygeai/tests/integration/lab/processes/test_get_process.py +2 -4
- pygeai/tests/integration/lab/processes/test_list_process_instances.py +1 -3
- pygeai/tests/integration/lab/processes/test_update_process.py +3 -9
- pygeai/tests/integration/lab/reasoning_strategies/test_update_reasoning_strategy.py +1 -2
- pygeai/tests/integration/lab/tools/test_delete_tool.py +1 -1
- pygeai/tests/integration/lab/tools/test_list_tools.py +1 -1
- pygeai/tests/integration/lab/tools/test_update_tool.py +1 -1
- pygeai/tests/lab/agents/test_clients.py +17 -17
- pygeai/tests/lab/processes/test_clients.py +67 -67
- pygeai/tests/lab/processes/test_mappers.py +23 -23
- pygeai/tests/lab/spec/test_loader.py +0 -2
- pygeai/tests/lab/spec/test_parsers.py +1 -2
- pygeai/tests/lab/strategies/test_clients.py +10 -10
- pygeai/tests/lab/test_managers.py +3 -5
- pygeai/tests/lab/test_mappers.py +1 -4
- pygeai/tests/lab/tools/test_clients.py +21 -21
- pygeai/tests/lab/tools/test_mappers.py +0 -1
- pygeai/tests/organization/limits/test_clients.py +33 -33
- pygeai/tests/organization/limits/test_managers.py +7 -7
- pygeai/tests/organization/test_clients.py +78 -60
- pygeai/tests/proxy/test_clients.py +1 -1
- pygeai/tests/proxy/test_integration.py +1 -4
- pygeai/tests/proxy/test_managers.py +1 -2
- pygeai/tests/proxy/test_servers.py +1 -2
- pygeai/tests/snippets/assistants/rag/delete_rag_assistant.py +0 -1
- pygeai/tests/snippets/assistants/rag/get_documents.py +0 -1
- pygeai/tests/snippets/assistants/rag/get_rag_assistant_data.py +0 -1
- pygeai/tests/snippets/chat/get_request_status.py +0 -1
- pygeai/tests/snippets/dbg/file_debugging.py +72 -0
- pygeai/tests/snippets/dbg/module_debugging.py +60 -0
- pygeai/tests/snippets/embeddings/cohere_example.py +2 -2
- pygeai/tests/snippets/embeddings/openai_base64_example.py +1 -1
- pygeai/tests/snippets/evaluation/dataset/complete_workflow_example.py +8 -8
- pygeai/tests/snippets/evaluation/plan/complete_workflow_example.py +5 -5
- pygeai/tests/snippets/evaluation/result/complete_workflow_example.py +3 -3
- pygeai/tests/snippets/lab/agentic_flow_example_1.py +1 -1
- pygeai/tests/snippets/lab/agentic_flow_example_2.py +3 -4
- pygeai/tests/snippets/lab/agents/create_agent_with_permissions.py +2 -2
- pygeai/tests/snippets/lab/agents/delete_agent.py +1 -2
- pygeai/tests/snippets/lab/agents/get_agent.py +1 -1
- pygeai/tests/snippets/lab/agents/get_agent_with_new_fields.py +10 -10
- pygeai/tests/snippets/lab/agents/get_sharing_link.py +0 -1
- pygeai/tests/snippets/lab/agents/list_agents.py +1 -1
- pygeai/tests/snippets/lab/agents/publish_agent_revision.py +0 -1
- pygeai/tests/snippets/lab/agents/update_agent_properties.py +1 -1
- pygeai/tests/snippets/lab/crud_ui.py +3 -5
- pygeai/tests/snippets/lab/processes/kbs/get_kb.py +0 -1
- pygeai/tests/snippets/lab/processes/kbs/list_kbs.py +0 -1
- pygeai/tests/snippets/lab/processes/list_processes.py +1 -1
- pygeai/tests/snippets/lab/samples/summarize_files.py +0 -3
- pygeai/tests/snippets/lab/strategies/get_reasoning_strategy.py +0 -1
- pygeai/tests/snippets/lab/strategies/list_reasoning_strategies.py +1 -1
- pygeai/tests/snippets/lab/tools/get_tool.py +1 -1
- pygeai/tests/snippets/lab/tools/publish_tool_revision.py +0 -1
- pygeai/tests/snippets/lab/tools/set_parameters.py +1 -2
- pygeai/tests/snippets/lab/use_cases/c_code_fixer_agent_flow.py +2 -3
- pygeai/tests/snippets/lab/use_cases/file_summarizer_example_2.py +1 -1
- pygeai/tests/snippets/lab/use_cases/update_cli_expert.py +0 -1
- pygeai/tests/snippets/lab/use_cases/update_lab_expert.py +0 -1
- pygeai/tests/snippets/lab/use_cases/update_web_designer.py +0 -1
- pygeai/tests/snippets/lab/use_cases/update_web_reader.py +0 -1
- pygeai/tests/snippets/migrate/orchestrator_examples.py +1 -1
- {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/METADATA +32 -7
- {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/RECORD +216 -205
- {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/WHEEL +0 -0
- {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/entry_points.txt +0 -0
- {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/licenses/LICENSE +0 -0
- {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/top_level.txt +0 -0
|
@@ -160,7 +160,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
160
160
|
process_id=self.process_id,
|
|
161
161
|
name="Updated Process"
|
|
162
162
|
)
|
|
163
|
-
except InvalidAPIResponseException
|
|
163
|
+
except InvalidAPIResponseException:
|
|
164
164
|
result = self.mock_response.text
|
|
165
165
|
|
|
166
166
|
self.assertEqual(result, "success text")
|
|
@@ -186,7 +186,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
186
186
|
result = self.client.get_process(
|
|
187
187
|
process_id=self.process_id
|
|
188
188
|
)
|
|
189
|
-
except InvalidAPIResponseException
|
|
189
|
+
except InvalidAPIResponseException:
|
|
190
190
|
result = self.mock_response.text
|
|
191
191
|
|
|
192
192
|
self.assertEqual(result, "success text")
|
|
@@ -197,7 +197,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
197
197
|
|
|
198
198
|
try:
|
|
199
199
|
result = self.client.list_processes()
|
|
200
|
-
except InvalidAPIResponseException
|
|
200
|
+
except InvalidAPIResponseException:
|
|
201
201
|
result = self.mock_response.text
|
|
202
202
|
|
|
203
203
|
self.assertEqual(result, "success text")
|
|
@@ -223,7 +223,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
223
223
|
result = self.client.list_process_instances(
|
|
224
224
|
process_id=self.process_id
|
|
225
225
|
)
|
|
226
|
-
except InvalidAPIResponseException
|
|
226
|
+
except InvalidAPIResponseException:
|
|
227
227
|
result = self.mock_response.text
|
|
228
228
|
|
|
229
229
|
self.assertEqual(result, "success text")
|
|
@@ -247,7 +247,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
247
247
|
result = self.client.delete_process(
|
|
248
248
|
process_id=self.process_id
|
|
249
249
|
)
|
|
250
|
-
except InvalidAPIResponseException
|
|
250
|
+
except InvalidAPIResponseException:
|
|
251
251
|
result = self.mock_response.text
|
|
252
252
|
|
|
253
253
|
self.assertEqual(result, "success text")
|
|
@@ -280,7 +280,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
280
280
|
process_id=self.process_id,
|
|
281
281
|
revision="2"
|
|
282
282
|
)
|
|
283
|
-
except InvalidAPIResponseException
|
|
283
|
+
except InvalidAPIResponseException:
|
|
284
284
|
result = self.mock_response.text
|
|
285
285
|
|
|
286
286
|
self.assertEqual(result, "success text")
|
|
@@ -293,7 +293,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
293
293
|
result = self.client.create_task(
|
|
294
294
|
name="Test Task"
|
|
295
295
|
)
|
|
296
|
-
except InvalidAPIResponseException
|
|
296
|
+
except InvalidAPIResponseException:
|
|
297
297
|
result = self.mock_response.text
|
|
298
298
|
|
|
299
299
|
self.assertEqual(result, "success text")
|
|
@@ -333,7 +333,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
333
333
|
result = self.client.get_task(
|
|
334
334
|
task_id=self.task_id
|
|
335
335
|
)
|
|
336
|
-
except InvalidAPIResponseException
|
|
336
|
+
except InvalidAPIResponseException:
|
|
337
337
|
result = self.mock_response.text
|
|
338
338
|
|
|
339
339
|
self.assertEqual(result, "success text")
|
|
@@ -357,7 +357,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
357
357
|
|
|
358
358
|
try:
|
|
359
359
|
result = self.client.list_tasks()
|
|
360
|
-
except InvalidAPIResponseException
|
|
360
|
+
except InvalidAPIResponseException:
|
|
361
361
|
result = self.mock_response.text
|
|
362
362
|
|
|
363
363
|
self.assertEqual(result, "success text")
|
|
@@ -407,7 +407,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
407
407
|
task_id=self.task_id,
|
|
408
408
|
name="Updated Task"
|
|
409
409
|
)
|
|
410
|
-
except InvalidAPIResponseException
|
|
410
|
+
except InvalidAPIResponseException:
|
|
411
411
|
result = self.mock_response.text
|
|
412
412
|
|
|
413
413
|
self.assertEqual(result, "success text")
|
|
@@ -432,7 +432,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
432
432
|
result = self.client.delete_task(
|
|
433
433
|
task_id=self.task_id
|
|
434
434
|
)
|
|
435
|
-
except InvalidAPIResponseException
|
|
435
|
+
except InvalidAPIResponseException:
|
|
436
436
|
result = self.mock_response.text
|
|
437
437
|
|
|
438
438
|
self.assertEqual(result, "success text")
|
|
@@ -485,7 +485,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
485
485
|
task_id=self.task_id,
|
|
486
486
|
revision="3"
|
|
487
487
|
)
|
|
488
|
-
except InvalidAPIResponseException
|
|
488
|
+
except InvalidAPIResponseException:
|
|
489
489
|
result = self.mock_response.text
|
|
490
490
|
|
|
491
491
|
self.assertEqual(result, "success text")
|
|
@@ -498,7 +498,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
498
498
|
result = self.client.start_instance(
|
|
499
499
|
process_name="Test Process"
|
|
500
500
|
)
|
|
501
|
-
except InvalidAPIResponseException
|
|
501
|
+
except InvalidAPIResponseException:
|
|
502
502
|
result = self.mock_response.text
|
|
503
503
|
|
|
504
504
|
self.assertEqual(result, "success text")
|
|
@@ -535,7 +535,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
535
535
|
result = self.client.abort_instance(
|
|
536
536
|
instance_id=self.instance_id
|
|
537
537
|
)
|
|
538
|
-
except InvalidAPIResponseException
|
|
538
|
+
except InvalidAPIResponseException:
|
|
539
539
|
result = self.mock_response.text
|
|
540
540
|
|
|
541
541
|
self.assertEqual(result, "success text")
|
|
@@ -558,7 +558,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
558
558
|
result = self.client.get_instance(
|
|
559
559
|
instance_id=self.instance_id
|
|
560
560
|
)
|
|
561
|
-
except InvalidAPIResponseException
|
|
561
|
+
except InvalidAPIResponseException:
|
|
562
562
|
result = self.mock_response.text
|
|
563
563
|
|
|
564
564
|
self.assertEqual(result, "success text")
|
|
@@ -589,7 +589,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
589
589
|
result = self.client.get_instance_history(
|
|
590
590
|
instance_id=self.instance_id
|
|
591
591
|
)
|
|
592
|
-
except InvalidAPIResponseException
|
|
592
|
+
except InvalidAPIResponseException:
|
|
593
593
|
result = self.mock_response.text
|
|
594
594
|
|
|
595
595
|
self.assertEqual(result, "success text")
|
|
@@ -620,7 +620,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
620
620
|
result = self.client.get_thread_information(
|
|
621
621
|
thread_id=self.thread_id
|
|
622
622
|
)
|
|
623
|
-
except InvalidAPIResponseException
|
|
623
|
+
except InvalidAPIResponseException:
|
|
624
624
|
result = self.mock_response.text
|
|
625
625
|
|
|
626
626
|
self.assertEqual(result, "success text")
|
|
@@ -653,7 +653,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
653
653
|
instance_id=self.instance_id,
|
|
654
654
|
signal_name="approval"
|
|
655
655
|
)
|
|
656
|
-
except InvalidAPIResponseException
|
|
656
|
+
except InvalidAPIResponseException:
|
|
657
657
|
result = self.mock_response.text
|
|
658
658
|
|
|
659
659
|
self.assertEqual(result, "success text")
|
|
@@ -675,7 +675,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
675
675
|
result = self.client.create_kb(
|
|
676
676
|
name="Test KB"
|
|
677
677
|
)
|
|
678
|
-
except InvalidAPIResponseException
|
|
678
|
+
except InvalidAPIResponseException:
|
|
679
679
|
result = self.mock_response.text
|
|
680
680
|
|
|
681
681
|
self.assertEqual(result, "success text")
|
|
@@ -714,7 +714,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
714
714
|
result = self.client.get_kb(
|
|
715
715
|
kb_id=self.kb_id
|
|
716
716
|
)
|
|
717
|
-
except InvalidAPIResponseException
|
|
717
|
+
except InvalidAPIResponseException:
|
|
718
718
|
result = self.mock_response.text
|
|
719
719
|
|
|
720
720
|
self.assertEqual(result, "success text")
|
|
@@ -746,7 +746,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
746
746
|
|
|
747
747
|
try:
|
|
748
748
|
result = self.client.list_kbs()
|
|
749
|
-
except InvalidAPIResponseException
|
|
749
|
+
except InvalidAPIResponseException:
|
|
750
750
|
result = self.mock_response.text
|
|
751
751
|
|
|
752
752
|
self.assertEqual(result, "success text")
|
|
@@ -771,7 +771,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
771
771
|
result = self.client.delete_kb(
|
|
772
772
|
kb_id=self.kb_id
|
|
773
773
|
)
|
|
774
|
-
except InvalidAPIResponseException
|
|
774
|
+
except InvalidAPIResponseException:
|
|
775
775
|
result = self.mock_response.text
|
|
776
776
|
|
|
777
777
|
self.assertEqual(result, "success text")
|
|
@@ -791,7 +791,7 @@ class TestAgenticProcessMapper(unittest.TestCase):
|
|
|
791
791
|
|
|
792
792
|
try:
|
|
793
793
|
result = self.client.list_jobs()
|
|
794
|
-
except InvalidAPIResponseException
|
|
794
|
+
except InvalidAPIResponseException:
|
|
795
795
|
result = self.mock_response.text
|
|
796
796
|
|
|
797
797
|
self.assertEqual(result, "success text")
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import unittest
|
|
2
1
|
from unittest import TestCase
|
|
3
2
|
from pydantic import ValidationError
|
|
4
3
|
from pygeai.lab.spec.parsers import AgentParser, ToolParser, TaskParser, AgenticProcessParser
|
|
5
|
-
from pygeai.lab.models import Agent, Tool, Task, AgenticProcess
|
|
4
|
+
from pygeai.lab.models import Agent, Tool, Task, AgenticProcess
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
class TestParser(TestCase):
|
|
@@ -2,7 +2,7 @@ import unittest
|
|
|
2
2
|
from unittest.mock import patch
|
|
3
3
|
from json import JSONDecodeError
|
|
4
4
|
from pygeai.lab.strategies.clients import ReasoningStrategyClient
|
|
5
|
-
from pygeai.core.common.exceptions import
|
|
5
|
+
from pygeai.core.common.exceptions import APIResponseError
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class TestReasoningStrategyClient(unittest.TestCase):
|
|
@@ -15,7 +15,7 @@ class TestReasoningStrategyClient(unittest.TestCase):
|
|
|
15
15
|
self.reasoning_strategy_id = "strat-123"
|
|
16
16
|
self.reasoning_strategy_name = "TestStrategy"
|
|
17
17
|
|
|
18
|
-
@patch("pygeai.core.services.rest.
|
|
18
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
19
19
|
def test_list_reasoning_strategies_success(self, mock_get):
|
|
20
20
|
expected_response = {"strategies": [{"id": "strat-1", "name": "Strategy1"}]}
|
|
21
21
|
mock_response = mock_get.return_value
|
|
@@ -40,7 +40,7 @@ class TestReasoningStrategyClient(unittest.TestCase):
|
|
|
40
40
|
self.assertTrue(params['allowExternal'])
|
|
41
41
|
self.assertEqual(params['accessScope'], "public")
|
|
42
42
|
|
|
43
|
-
@patch("pygeai.core.services.rest.
|
|
43
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
44
44
|
def test_list_reasoning_strategies_json_decode_error(self, mock_get):
|
|
45
45
|
mock_response = mock_get.return_value
|
|
46
46
|
mock_response.json.side_effect = JSONDecodeError("Invalid JSON", "", 0)
|
|
@@ -59,7 +59,7 @@ class TestReasoningStrategyClient(unittest.TestCase):
|
|
|
59
59
|
|
|
60
60
|
self.assertEqual(str(context.exception), "Access scope must be either 'public' or 'private'.")
|
|
61
61
|
|
|
62
|
-
@patch("pygeai.core.services.rest.
|
|
62
|
+
@patch("pygeai.core.services.rest.GEAIApiService.post")
|
|
63
63
|
def test_create_reasoning_strategy_success(self, mock_post):
|
|
64
64
|
name = "TestStrategy"
|
|
65
65
|
system_prompt = "Test system prompt"
|
|
@@ -94,7 +94,7 @@ class TestReasoningStrategyClient(unittest.TestCase):
|
|
|
94
94
|
headers = call_args[1]['headers']
|
|
95
95
|
self.assertEqual(headers['ProjectId'], self.project_id)
|
|
96
96
|
|
|
97
|
-
@patch("pygeai.core.services.rest.
|
|
97
|
+
@patch("pygeai.core.services.rest.GEAIApiService.post")
|
|
98
98
|
def test_create_reasoning_strategy_json_decode_error(self, mock_post):
|
|
99
99
|
name = "TestStrategy"
|
|
100
100
|
system_prompt = "Test system prompt"
|
|
@@ -112,7 +112,7 @@ class TestReasoningStrategyClient(unittest.TestCase):
|
|
|
112
112
|
mock_post.assert_called_once()
|
|
113
113
|
self.assertIn("API returned an error", str(context.exception)) # "Unable to create reasoning strategy", str(context.exception))
|
|
114
114
|
|
|
115
|
-
@patch("pygeai.core.services.rest.
|
|
115
|
+
@patch("pygeai.core.services.rest.GEAIApiService.put")
|
|
116
116
|
def test_update_reasoning_strategy_success(self, mock_put):
|
|
117
117
|
name = "UpdatedStrategy"
|
|
118
118
|
system_prompt = "Updated prompt"
|
|
@@ -150,7 +150,7 @@ class TestReasoningStrategyClient(unittest.TestCase):
|
|
|
150
150
|
headers = call_args[1]['headers']
|
|
151
151
|
self.assertEqual(headers['ProjectId'], self.project_id)
|
|
152
152
|
|
|
153
|
-
@patch("pygeai.core.services.rest.
|
|
153
|
+
@patch("pygeai.core.services.rest.GEAIApiService.put")
|
|
154
154
|
def test_update_reasoning_strategy_json_decode_error(self, mock_put):
|
|
155
155
|
name = "UpdatedStrategy"
|
|
156
156
|
mock_response = mock_put.return_value
|
|
@@ -185,7 +185,7 @@ class TestReasoningStrategyClient(unittest.TestCase):
|
|
|
185
185
|
|
|
186
186
|
self.assertEqual(str(context.exception), "Type must be 'addendum'.")
|
|
187
187
|
|
|
188
|
-
@patch("pygeai.core.services.rest.
|
|
188
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
189
189
|
def test_get_reasoning_strategy_success_with_id(self, mock_get):
|
|
190
190
|
expected_response = {"id": self.reasoning_strategy_id, "name": "TestStrategy"}
|
|
191
191
|
mock_response = mock_get.return_value
|
|
@@ -201,7 +201,7 @@ class TestReasoningStrategyClient(unittest.TestCase):
|
|
|
201
201
|
headers = mock_get.call_args[1]['headers']
|
|
202
202
|
self.assertEqual(headers['ProjectId'], self.project_id)
|
|
203
203
|
|
|
204
|
-
@patch("pygeai.core.services.rest.
|
|
204
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
205
205
|
def test_get_reasoning_strategy_success_with_name(self, mock_get):
|
|
206
206
|
expected_response = {"name": self.reasoning_strategy_name}
|
|
207
207
|
mock_response = mock_get.return_value
|
|
@@ -215,7 +215,7 @@ class TestReasoningStrategyClient(unittest.TestCase):
|
|
|
215
215
|
self.assertEqual(result, expected_response)
|
|
216
216
|
mock_get.assert_called_once()
|
|
217
217
|
|
|
218
|
-
@patch("pygeai.core.services.rest.
|
|
218
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
219
219
|
def test_get_reasoning_strategy_json_decode_error(self, mock_get):
|
|
220
220
|
mock_response = mock_get.return_value
|
|
221
221
|
mock_response.json.side_effect = JSONDecodeError("Invalid JSON", "", 0)
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import unittest
|
|
2
|
-
from unittest.mock import
|
|
3
|
-
from pygeai.core.common.exceptions import APIError
|
|
2
|
+
from unittest.mock import patch
|
|
3
|
+
from pygeai.core.common.exceptions import APIError
|
|
4
4
|
from pygeai.lab.models import FilterSettings, Agent, AgentList, SharingLink, Tool, ToolList, ToolParameter, \
|
|
5
5
|
ReasoningStrategyList, ReasoningStrategy, AgenticProcess, AgenticProcessList, ProcessInstanceList, Task, TaskList, \
|
|
6
|
-
ProcessInstance, VariableList, KnowledgeBase, KnowledgeBaseList, JobList
|
|
7
|
-
Model, AgentData, AgenticActivity, Event, SequenceFlow, Variable, ArtifactSignal, UserSignal, ArtifactTypeList, \
|
|
8
|
-
ArtifactType, JobParameter
|
|
6
|
+
ProcessInstance, VariableList, KnowledgeBase, KnowledgeBaseList, JobList
|
|
9
7
|
from pygeai.lab.managers import AILabManager
|
|
10
8
|
|
|
11
9
|
|
pygeai/tests/lab/test_mappers.py
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import unittest
|
|
2
1
|
from unittest import TestCase
|
|
3
|
-
from typing import List, Dict
|
|
4
2
|
|
|
5
3
|
from pygeai.lab.models import (
|
|
6
|
-
AgenticProcess,
|
|
7
|
-
SequenceFlow, Task, AgenticProcessList, TaskList, ProcessInstance, ProcessInstanceList, Variable, Job
|
|
4
|
+
AgenticProcess, Job
|
|
8
5
|
)
|
|
9
6
|
from pygeai.lab.processes.mappers import AgenticProcessMapper, TaskMapper, ProcessInstanceMapper, JobMapper
|
|
10
7
|
|
|
@@ -5,7 +5,7 @@ from unittest.mock import patch
|
|
|
5
5
|
from pygeai.core.common.exceptions import InvalidAPIResponseException
|
|
6
6
|
from pygeai.lab.constants import VALID_SCOPES, VALID_ACCESS_SCOPES, VALID_REPORT_EVENTS
|
|
7
7
|
from pygeai.lab.tools.clients import ToolClient
|
|
8
|
-
from pygeai.lab.tools.endpoints import
|
|
8
|
+
from pygeai.lab.tools.endpoints import LIST_TOOLS_V2, GET_TOOL_V2, UPDATE_TOOL_V2, UPSERT_TOOL_V2, \
|
|
9
9
|
PUBLISH_TOOL_REVISION_V2, GET_PARAMETER_V2, SET_PARAMETER_V2, DELETE_TOOL_V2
|
|
10
10
|
|
|
11
11
|
|
|
@@ -22,7 +22,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
22
22
|
self.tool_public_name = "test-tool"
|
|
23
23
|
self.parameters = [{"key": "param1", "dataType": "String", "description": "Param 1", "isRequired": True}]
|
|
24
24
|
|
|
25
|
-
@patch("pygeai.core.services.rest.
|
|
25
|
+
@patch("pygeai.core.services.rest.GEAIApiService.post")
|
|
26
26
|
def test_create_tool_success(self, mock_post):
|
|
27
27
|
name = "TestTool"
|
|
28
28
|
description = "A test tool"
|
|
@@ -93,7 +93,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
93
93
|
)
|
|
94
94
|
self.assertEqual(str(context.exception), f"Report events must be one of {', '.join(VALID_REPORT_EVENTS)}.")
|
|
95
95
|
|
|
96
|
-
@patch("pygeai.core.services.rest.
|
|
96
|
+
@patch("pygeai.core.services.rest.GEAIApiService.post")
|
|
97
97
|
def test_create_tool_json_decode_error(self, mock_post):
|
|
98
98
|
name = "TestTool"
|
|
99
99
|
mock_response = mock_post.return_value
|
|
@@ -109,7 +109,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
109
109
|
self.assertEqual(str(context.exception), f"Unable to create tool for project {self.project_id}: Invalid JSON response")
|
|
110
110
|
mock_post.assert_called_once()
|
|
111
111
|
|
|
112
|
-
@patch("pygeai.core.services.rest.
|
|
112
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
113
113
|
def test_list_tools_success(self, mock_get):
|
|
114
114
|
expected_response = {"tools": [{"id": "tool-1", "name": "Tool1"}]}
|
|
115
115
|
mock_response = mock_get.return_value
|
|
@@ -145,7 +145,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
145
145
|
)
|
|
146
146
|
self.assertEqual(str(context.exception), f"Scope must be one of {', '.join(VALID_SCOPES)}.")
|
|
147
147
|
|
|
148
|
-
@patch("pygeai.core.services.rest.
|
|
148
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
149
149
|
def test_list_tools_json_decode_error(self, mock_get):
|
|
150
150
|
mock_response = mock_get.return_value
|
|
151
151
|
mock_response.status_code = 200
|
|
@@ -160,7 +160,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
160
160
|
self.assertEqual(str(context.exception), f"Unable to list tools for project {self.project_id}: Invalid JSON response")
|
|
161
161
|
mock_get.assert_called_once()
|
|
162
162
|
|
|
163
|
-
@patch("pygeai.core.services.rest.
|
|
163
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
164
164
|
def test_get_tool_success(self, mock_get):
|
|
165
165
|
expected_response = {"id": self.tool_id, "name": "TestTool"}
|
|
166
166
|
mock_response = mock_get.return_value
|
|
@@ -184,7 +184,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
184
184
|
}
|
|
185
185
|
)
|
|
186
186
|
|
|
187
|
-
@patch("pygeai.core.services.rest.
|
|
187
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
188
188
|
def test_get_tool_json_decode_error(self, mock_get):
|
|
189
189
|
mock_response = mock_get.return_value
|
|
190
190
|
mock_response.status_code = 200
|
|
@@ -199,7 +199,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
199
199
|
self.assertEqual(str(context.exception), f"Unable to retrieve tool {self.tool_id} for project {self.project_id}: Invalid JSON response")
|
|
200
200
|
mock_get.assert_called_once()
|
|
201
201
|
|
|
202
|
-
@patch("pygeai.core.services.rest.
|
|
202
|
+
@patch("pygeai.core.services.rest.GEAIApiService.delete")
|
|
203
203
|
def test_delete_tool_success_with_id(self, mock_delete):
|
|
204
204
|
mock_response = mock_delete.return_value
|
|
205
205
|
mock_response.status_code = 204
|
|
@@ -213,7 +213,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
213
213
|
endpoint=DELETE_TOOL_V2.format(toolId=self.tool_id)
|
|
214
214
|
)
|
|
215
215
|
|
|
216
|
-
@patch("pygeai.core.services.rest.
|
|
216
|
+
@patch("pygeai.core.services.rest.GEAIApiService.delete")
|
|
217
217
|
def test_delete_tool_success_with_name(self, mock_delete):
|
|
218
218
|
mock_response = mock_delete.return_value
|
|
219
219
|
mock_response.status_code = 204
|
|
@@ -232,7 +232,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
232
232
|
self.tool_client.delete_tool()
|
|
233
233
|
self.assertEqual(str(context.exception), "Either tool_id or tool_name must be provided.")
|
|
234
234
|
|
|
235
|
-
@patch("pygeai.core.services.rest.
|
|
235
|
+
@patch("pygeai.core.services.rest.GEAIApiService.delete")
|
|
236
236
|
def test_delete_tool_json_decode_error(self, mock_delete):
|
|
237
237
|
mock_response = mock_delete.return_value
|
|
238
238
|
mock_response.status_code = 200
|
|
@@ -247,7 +247,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
247
247
|
self.assertEqual(str(context.exception), f"Unable to delete tool {self.tool_id} in project {self.project_id}: Invalid JSON response")
|
|
248
248
|
mock_delete.assert_called_once()
|
|
249
249
|
|
|
250
|
-
@patch("pygeai.core.services.rest.
|
|
250
|
+
@patch("pygeai.core.services.rest.GEAIApiService.put")
|
|
251
251
|
def test_update_tool_success(self, mock_put):
|
|
252
252
|
name = "UpdatedTool"
|
|
253
253
|
description = "Updated description"
|
|
@@ -299,7 +299,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
299
299
|
self.assertEqual(data['reportEvents'], report_events)
|
|
300
300
|
self.assertEqual(data['parameters'], self.parameters)
|
|
301
301
|
|
|
302
|
-
@patch("pygeai.core.services.rest.
|
|
302
|
+
@patch("pygeai.core.services.rest.GEAIApiService.put")
|
|
303
303
|
def test_update_tool_with_upsert(self, mock_put):
|
|
304
304
|
name = "UpsertedTool"
|
|
305
305
|
expected_response = {"id": self.tool_id, "name": name}
|
|
@@ -343,7 +343,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
343
343
|
)
|
|
344
344
|
self.assertEqual(str(context.exception), f"Report events must be one of {', '.join(VALID_REPORT_EVENTS)}.")
|
|
345
345
|
|
|
346
|
-
@patch("pygeai.core.services.rest.
|
|
346
|
+
@patch("pygeai.core.services.rest.GEAIApiService.put")
|
|
347
347
|
def test_update_tool_json_decode_error(self, mock_put):
|
|
348
348
|
mock_response = mock_put.return_value
|
|
349
349
|
mock_response.status_code = 200
|
|
@@ -359,7 +359,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
359
359
|
self.assertEqual(str(context.exception), f"Unable to update tool {self.tool_id} in project {self.project_id}: Invalid JSON response")
|
|
360
360
|
mock_put.assert_called_once()
|
|
361
361
|
|
|
362
|
-
@patch("pygeai.core.services.rest.
|
|
362
|
+
@patch("pygeai.core.services.rest.GEAIApiService.post")
|
|
363
363
|
def test_publish_tool_revision_success(self, mock_post):
|
|
364
364
|
revision = "2"
|
|
365
365
|
expected_response = {"status": "published"}
|
|
@@ -378,7 +378,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
378
378
|
data={"revision": revision}
|
|
379
379
|
)
|
|
380
380
|
|
|
381
|
-
@patch("pygeai.core.services.rest.
|
|
381
|
+
@patch("pygeai.core.services.rest.GEAIApiService.post")
|
|
382
382
|
def test_publish_tool_revision_json_decode_error(self, mock_post):
|
|
383
383
|
revision = "2"
|
|
384
384
|
mock_response = mock_post.return_value
|
|
@@ -395,7 +395,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
395
395
|
self.assertEqual(str(context.exception), f"Unable to publish revision {revision} for tool {self.tool_id} in project {self.project_id}: Invalid JSON response")
|
|
396
396
|
mock_post.assert_called_once()
|
|
397
397
|
|
|
398
|
-
@patch("pygeai.core.services.rest.
|
|
398
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
399
399
|
def test_get_parameter_success_with_id(self, mock_get):
|
|
400
400
|
expected_response = {"parameters": [{"key": "param1"}]}
|
|
401
401
|
mock_response = mock_get.return_value
|
|
@@ -419,7 +419,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
419
419
|
}
|
|
420
420
|
)
|
|
421
421
|
|
|
422
|
-
@patch("pygeai.core.services.rest.
|
|
422
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
423
423
|
def test_get_parameter_success_with_public_name(self, mock_get):
|
|
424
424
|
expected_response = {"parameters": [{"key": "param1"}]}
|
|
425
425
|
mock_response = mock_get.return_value
|
|
@@ -448,7 +448,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
448
448
|
self.tool_client.get_parameter()
|
|
449
449
|
self.assertEqual(str(context.exception), "Either tool_id or tool_public_name must be provided.")
|
|
450
450
|
|
|
451
|
-
@patch("pygeai.core.services.rest.
|
|
451
|
+
@patch("pygeai.core.services.rest.GEAIApiService.get")
|
|
452
452
|
def test_get_parameter_json_decode_error(self, mock_get):
|
|
453
453
|
mock_response = mock_get.return_value
|
|
454
454
|
mock_response.status_code = 200
|
|
@@ -463,7 +463,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
463
463
|
self.assertEqual(str(context.exception), f"Unable to retrieve parameters for tool {self.tool_id} in project {self.project_id}: Invalid JSON response")
|
|
464
464
|
mock_get.assert_called_once()
|
|
465
465
|
|
|
466
|
-
@patch("pygeai.core.services.rest.
|
|
466
|
+
@patch("pygeai.core.services.rest.GEAIApiService.post")
|
|
467
467
|
def test_set_parameter_success_with_id(self, mock_post):
|
|
468
468
|
mock_response = mock_post.return_value
|
|
469
469
|
mock_response.status_code = 204
|
|
@@ -479,7 +479,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
479
479
|
data={"parameterDefinition": {"parameters": self.parameters}}
|
|
480
480
|
)
|
|
481
481
|
|
|
482
|
-
@patch("pygeai.core.services.rest.
|
|
482
|
+
@patch("pygeai.core.services.rest.GEAIApiService.post")
|
|
483
483
|
def test_set_parameter_success_with_public_name(self, mock_post):
|
|
484
484
|
mock_response = mock_post.return_value
|
|
485
485
|
mock_response.status_code = 204
|
|
@@ -504,7 +504,7 @@ class TestToolClient(unittest.TestCase):
|
|
|
504
504
|
self.tool_client.set_parameter(tool_id=self.tool_id, parameters=[])
|
|
505
505
|
self.assertEqual(str(context.exception), "Parameters list must be provided and non-empty.")
|
|
506
506
|
|
|
507
|
-
@patch("pygeai.core.services.rest.
|
|
507
|
+
@patch("pygeai.core.services.rest.GEAIApiService.post")
|
|
508
508
|
def test_set_parameter_json_decode_error(self, mock_post):
|
|
509
509
|
mock_response = mock_post.return_value
|
|
510
510
|
mock_response.status_code = 200
|