pygeai 0.6.0b13__py3-none-any.whl → 0.6.1__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.
Files changed (217) hide show
  1. pygeai/__init__.py +1 -2
  2. pygeai/_docs/source/content/api_reference/project.rst +392 -0
  3. pygeai/_docs/source/content/authentication.rst +130 -1
  4. pygeai/_docs/source/content/debugger.rst +327 -157
  5. pygeai/_docs/source/content/migration.rst +391 -7
  6. pygeai/_docs/source/pygeai.core.common.rst +8 -0
  7. pygeai/_docs/source/pygeai.tests.auth.rst +56 -0
  8. pygeai/_docs/source/pygeai.tests.cli.rst +8 -0
  9. pygeai/admin/clients.py +1 -3
  10. pygeai/analytics/clients.py +1 -1
  11. pygeai/assistant/clients.py +2 -7
  12. pygeai/assistant/data/clients.py +0 -8
  13. pygeai/assistant/data_analyst/clients.py +0 -2
  14. pygeai/assistant/managers.py +1 -1
  15. pygeai/assistant/rag/clients.py +0 -2
  16. pygeai/assistant/rag/mappers.py +9 -11
  17. pygeai/auth/clients.py +26 -7
  18. pygeai/auth/endpoints.py +2 -1
  19. pygeai/chat/clients.py +2 -2
  20. pygeai/chat/managers.py +1 -1
  21. pygeai/cli/commands/admin.py +13 -25
  22. pygeai/cli/commands/analytics.py +56 -88
  23. pygeai/cli/commands/assistant.py +84 -138
  24. pygeai/cli/commands/auth.py +23 -46
  25. pygeai/cli/commands/base.py +0 -1
  26. pygeai/cli/commands/chat.py +218 -209
  27. pygeai/cli/commands/common.py +5 -5
  28. pygeai/cli/commands/configuration.py +79 -29
  29. pygeai/cli/commands/docs.py +3 -4
  30. pygeai/cli/commands/embeddings.py +13 -19
  31. pygeai/cli/commands/evaluation.py +133 -344
  32. pygeai/cli/commands/feedback.py +7 -15
  33. pygeai/cli/commands/files.py +26 -53
  34. pygeai/cli/commands/gam.py +28 -69
  35. pygeai/cli/commands/lab/ai_lab.py +96 -142
  36. pygeai/cli/commands/lab/common.py +1 -1
  37. pygeai/cli/commands/lab/spec.py +12 -32
  38. pygeai/cli/commands/llm.py +9 -18
  39. pygeai/cli/commands/migrate.py +43 -99
  40. pygeai/cli/commands/organization.py +223 -196
  41. pygeai/cli/commands/rag.py +35 -58
  42. pygeai/cli/commands/rerank.py +21 -25
  43. pygeai/cli/commands/secrets.py +39 -67
  44. pygeai/cli/commands/usage_limits.py +50 -136
  45. pygeai/cli/commands/validators.py +1 -1
  46. pygeai/cli/geai.py +32 -3
  47. pygeai/cli/geai_proxy.py +6 -2
  48. pygeai/cli/install_man.py +1 -1
  49. pygeai/cli/parsers.py +1 -1
  50. pygeai/core/base/clients.py +90 -21
  51. pygeai/core/base/mappers.py +39 -55
  52. pygeai/core/base/session.py +134 -22
  53. pygeai/core/common/config.py +50 -13
  54. pygeai/core/common/constants.py +8 -0
  55. pygeai/core/common/exceptions.py +6 -0
  56. pygeai/core/embeddings/clients.py +0 -1
  57. pygeai/core/embeddings/managers.py +0 -1
  58. pygeai/core/feedback/clients.py +0 -2
  59. pygeai/core/feedback/models.py +1 -1
  60. pygeai/core/files/clients.py +0 -3
  61. pygeai/core/files/managers.py +1 -1
  62. pygeai/core/files/mappers.py +4 -5
  63. pygeai/core/llm/clients.py +0 -1
  64. pygeai/core/models.py +4 -4
  65. pygeai/core/plugins/clients.py +0 -3
  66. pygeai/core/plugins/models.py +2 -2
  67. pygeai/core/rerank/clients.py +0 -2
  68. pygeai/core/secrets/clients.py +0 -2
  69. pygeai/core/services/rest.py +80 -14
  70. pygeai/core/singleton.py +24 -0
  71. pygeai/dbg/__init__.py +2 -2
  72. pygeai/dbg/debugger.py +276 -38
  73. pygeai/evaluation/clients.py +2 -4
  74. pygeai/evaluation/dataset/clients.py +0 -1
  75. pygeai/evaluation/plan/clients.py +0 -2
  76. pygeai/evaluation/result/clients.py +0 -2
  77. pygeai/gam/clients.py +1 -3
  78. pygeai/health/clients.py +1 -3
  79. pygeai/lab/clients.py +0 -1
  80. pygeai/lab/managers.py +0 -1
  81. pygeai/lab/models.py +0 -1
  82. pygeai/lab/strategies/clients.py +1 -2
  83. pygeai/lab/tools/clients.py +2 -2
  84. pygeai/lab/tools/mappers.py +1 -1
  85. pygeai/migration/strategies.py +5 -6
  86. pygeai/migration/tools.py +1 -1
  87. pygeai/organization/clients.py +118 -12
  88. pygeai/organization/endpoints.py +1 -0
  89. pygeai/organization/limits/clients.py +4 -6
  90. pygeai/organization/limits/managers.py +1 -4
  91. pygeai/organization/managers.py +2 -2
  92. pygeai/proxy/config.py +1 -0
  93. pygeai/proxy/managers.py +6 -5
  94. pygeai/tests/admin/test_clients.py +11 -11
  95. pygeai/tests/assistants/rag/test_clients.py +1 -1
  96. pygeai/tests/assistants/rag/test_models.py +1 -2
  97. pygeai/tests/assistants/test_clients.py +1 -1
  98. pygeai/tests/assistants/test_managers.py +1 -3
  99. pygeai/tests/auth/test_cli_configuration.py +252 -0
  100. pygeai/tests/auth/test_client_initialization.py +411 -0
  101. pygeai/tests/auth/test_clients.py +29 -27
  102. pygeai/tests/auth/test_config_manager.py +305 -0
  103. pygeai/tests/auth/test_header_injection.py +294 -0
  104. pygeai/tests/auth/test_oauth.py +3 -1
  105. pygeai/tests/auth/test_session_logging.py +119 -0
  106. pygeai/tests/auth/test_session_validation.py +408 -0
  107. pygeai/tests/auth/test_singleton_reset.py +201 -0
  108. pygeai/tests/chat/test_clients.py +1 -1
  109. pygeai/tests/chat/test_iris.py +1 -1
  110. pygeai/tests/chat/test_ui.py +0 -2
  111. pygeai/tests/cli/commands/lab/test_ai_lab.py +1 -3
  112. pygeai/tests/cli/commands/lab/test_common.py +0 -1
  113. pygeai/tests/cli/commands/test_chat.py +1 -1
  114. pygeai/tests/cli/commands/test_common.py +0 -1
  115. pygeai/tests/cli/commands/test_embeddings.py +2 -2
  116. pygeai/tests/cli/commands/test_evaluation.py +1 -9
  117. pygeai/tests/cli/commands/test_llm.py +1 -1
  118. pygeai/tests/cli/commands/test_migrate.py +1 -1
  119. pygeai/tests/cli/commands/test_rerank.py +0 -1
  120. pygeai/tests/cli/commands/test_secrets.py +1 -1
  121. pygeai/tests/cli/commands/test_show_help.py +0 -1
  122. pygeai/tests/cli/commands/test_validators.py +0 -1
  123. pygeai/tests/cli/test_credentials_flag.py +312 -0
  124. pygeai/tests/cli/test_error_handler.py +0 -1
  125. pygeai/tests/core/base/test_mappers.py +2 -2
  126. pygeai/tests/core/base/test_models.py +4 -4
  127. pygeai/tests/core/common/test_config.py +2 -7
  128. pygeai/tests/core/common/test_decorators.py +0 -1
  129. pygeai/tests/core/embeddings/test_managers.py +1 -1
  130. pygeai/tests/core/feedback/test_clients.py +2 -2
  131. pygeai/tests/core/files/test_clients.py +6 -6
  132. pygeai/tests/core/files/test_models.py +0 -1
  133. pygeai/tests/core/files/test_responses.py +0 -1
  134. pygeai/tests/core/llm/test_clients.py +1 -1
  135. pygeai/tests/core/plugins/test_clients.py +4 -4
  136. pygeai/tests/core/rerank/test_mappers.py +1 -3
  137. pygeai/tests/core/secrets/test_clients.py +2 -3
  138. pygeai/tests/core/services/test_rest.py +10 -10
  139. pygeai/tests/core/utils/test_console.py +0 -1
  140. pygeai/tests/dbg/test_debugger.py +95 -8
  141. pygeai/tests/evaluation/dataset/test_clients.py +24 -27
  142. pygeai/tests/evaluation/plan/test_clients.py +16 -18
  143. pygeai/tests/evaluation/result/test_clients.py +4 -5
  144. pygeai/tests/health/test_clients.py +2 -2
  145. pygeai/tests/integration/lab/agents/test_create_agent.py +1 -3
  146. pygeai/tests/integration/lab/agents/test_get_agent.py +1 -1
  147. pygeai/tests/integration/lab/processes/test_create_process.py +2 -2
  148. pygeai/tests/integration/lab/processes/test_create_task.py +2 -3
  149. pygeai/tests/integration/lab/processes/test_delete_process.py +0 -1
  150. pygeai/tests/integration/lab/processes/test_get_process.py +2 -4
  151. pygeai/tests/integration/lab/processes/test_list_process_instances.py +1 -3
  152. pygeai/tests/integration/lab/processes/test_update_process.py +3 -9
  153. pygeai/tests/integration/lab/reasoning_strategies/test_update_reasoning_strategy.py +1 -2
  154. pygeai/tests/integration/lab/tools/test_delete_tool.py +1 -1
  155. pygeai/tests/integration/lab/tools/test_list_tools.py +1 -1
  156. pygeai/tests/integration/lab/tools/test_update_tool.py +1 -1
  157. pygeai/tests/lab/agents/test_clients.py +17 -17
  158. pygeai/tests/lab/processes/test_clients.py +67 -67
  159. pygeai/tests/lab/processes/test_mappers.py +23 -23
  160. pygeai/tests/lab/spec/test_loader.py +0 -2
  161. pygeai/tests/lab/spec/test_parsers.py +1 -2
  162. pygeai/tests/lab/strategies/test_clients.py +10 -10
  163. pygeai/tests/lab/test_managers.py +3 -5
  164. pygeai/tests/lab/test_mappers.py +1 -4
  165. pygeai/tests/lab/tools/test_clients.py +21 -21
  166. pygeai/tests/lab/tools/test_mappers.py +0 -1
  167. pygeai/tests/organization/limits/test_clients.py +33 -33
  168. pygeai/tests/organization/limits/test_managers.py +7 -7
  169. pygeai/tests/organization/test_clients.py +78 -60
  170. pygeai/tests/proxy/test_clients.py +1 -1
  171. pygeai/tests/proxy/test_integration.py +1 -4
  172. pygeai/tests/proxy/test_managers.py +1 -2
  173. pygeai/tests/proxy/test_servers.py +1 -2
  174. pygeai/tests/snippets/assistants/rag/delete_rag_assistant.py +0 -1
  175. pygeai/tests/snippets/assistants/rag/get_documents.py +0 -1
  176. pygeai/tests/snippets/assistants/rag/get_rag_assistant_data.py +0 -1
  177. pygeai/tests/snippets/chat/get_request_status.py +0 -1
  178. pygeai/tests/snippets/dbg/file_debugging.py +72 -0
  179. pygeai/tests/snippets/dbg/module_debugging.py +60 -0
  180. pygeai/tests/snippets/embeddings/cohere_example.py +2 -2
  181. pygeai/tests/snippets/embeddings/openai_base64_example.py +1 -1
  182. pygeai/tests/snippets/evaluation/dataset/complete_workflow_example.py +8 -8
  183. pygeai/tests/snippets/evaluation/plan/complete_workflow_example.py +5 -5
  184. pygeai/tests/snippets/evaluation/result/complete_workflow_example.py +3 -3
  185. pygeai/tests/snippets/lab/agentic_flow_example_1.py +1 -1
  186. pygeai/tests/snippets/lab/agentic_flow_example_2.py +3 -4
  187. pygeai/tests/snippets/lab/agents/create_agent_with_permissions.py +2 -2
  188. pygeai/tests/snippets/lab/agents/delete_agent.py +1 -2
  189. pygeai/tests/snippets/lab/agents/get_agent.py +1 -1
  190. pygeai/tests/snippets/lab/agents/get_agent_with_new_fields.py +10 -10
  191. pygeai/tests/snippets/lab/agents/get_sharing_link.py +0 -1
  192. pygeai/tests/snippets/lab/agents/list_agents.py +1 -1
  193. pygeai/tests/snippets/lab/agents/publish_agent_revision.py +0 -1
  194. pygeai/tests/snippets/lab/agents/update_agent_properties.py +1 -1
  195. pygeai/tests/snippets/lab/crud_ui.py +3 -5
  196. pygeai/tests/snippets/lab/processes/kbs/get_kb.py +0 -1
  197. pygeai/tests/snippets/lab/processes/kbs/list_kbs.py +0 -1
  198. pygeai/tests/snippets/lab/processes/list_processes.py +1 -1
  199. pygeai/tests/snippets/lab/samples/summarize_files.py +0 -3
  200. pygeai/tests/snippets/lab/strategies/get_reasoning_strategy.py +0 -1
  201. pygeai/tests/snippets/lab/strategies/list_reasoning_strategies.py +1 -1
  202. pygeai/tests/snippets/lab/tools/get_tool.py +1 -1
  203. pygeai/tests/snippets/lab/tools/publish_tool_revision.py +0 -1
  204. pygeai/tests/snippets/lab/tools/set_parameters.py +1 -2
  205. pygeai/tests/snippets/lab/use_cases/c_code_fixer_agent_flow.py +2 -3
  206. pygeai/tests/snippets/lab/use_cases/file_summarizer_example_2.py +1 -1
  207. pygeai/tests/snippets/lab/use_cases/update_cli_expert.py +0 -1
  208. pygeai/tests/snippets/lab/use_cases/update_lab_expert.py +0 -1
  209. pygeai/tests/snippets/lab/use_cases/update_web_designer.py +0 -1
  210. pygeai/tests/snippets/lab/use_cases/update_web_reader.py +0 -1
  211. pygeai/tests/snippets/migrate/orchestrator_examples.py +1 -1
  212. {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/METADATA +32 -7
  213. {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/RECORD +217 -206
  214. {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/WHEEL +0 -0
  215. {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/entry_points.txt +0 -0
  216. {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/licenses/LICENSE +0 -0
  217. {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
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 as e:
794
+ except InvalidAPIResponseException:
795
795
  result = self.mock_response.text
796
796
 
797
797
  self.assertEqual(result, "success text")
@@ -1,8 +1,6 @@
1
- import unittest
2
1
  from unittest import TestCase
3
2
  import tempfile
4
3
  import os
5
- from pathlib import Path
6
4
  from pygeai.lab.spec.loader import JSONLoader
7
5
  from pygeai.core.common.exceptions import InvalidPathException, InvalidJSONException
8
6
 
@@ -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, Prompt, LlmConfig, Sampling, ModelList, Model, AgentData
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 InvalidAPIResponseException, APIResponseError, APIResponseError
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.ApiService.get")
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.ApiService.get")
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.ApiService.post")
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.ApiService.post")
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.ApiService.put")
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.ApiService.put")
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.ApiService.get")
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.ApiService.get")
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.ApiService.get")
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 MagicMock, patch
3
- from pygeai.core.common.exceptions import APIError, MissingRequirementException
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, Prompt, LlmConfig, Sampling, ModelList, \
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
 
@@ -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, KnowledgeBase, AgenticActivity, ArtifactSignal, UserSignal, Event,
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 CREATE_TOOL_V2, LIST_TOOLS_V2, GET_TOOL_V2, UPDATE_TOOL_V2, UPSERT_TOOL_V2, \
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.ApiService.post")
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.ApiService.post")
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.ApiService.get")
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.ApiService.get")
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.ApiService.get")
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.ApiService.get")
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.ApiService.delete")
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.ApiService.delete")
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.ApiService.delete")
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.ApiService.put")
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.ApiService.put")
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.ApiService.put")
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.ApiService.post")
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.ApiService.post")
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.ApiService.get")
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.ApiService.get")
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.ApiService.get")
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.ApiService.post")
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.ApiService.post")
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.ApiService.post")
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
@@ -1,5 +1,4 @@
1
1
  import unittest
2
- import json
3
2
  from pygeai.lab.tools.mappers import ToolMapper
4
3
  from pygeai.lab.models import Tool, ToolParameter, ToolMessage, ToolList
5
4