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.
Files changed (216) 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/pygeai.core.common.rst +8 -0
  6. pygeai/_docs/source/pygeai.tests.auth.rst +56 -0
  7. pygeai/_docs/source/pygeai.tests.cli.rst +8 -0
  8. pygeai/admin/clients.py +1 -3
  9. pygeai/analytics/clients.py +1 -1
  10. pygeai/assistant/clients.py +2 -7
  11. pygeai/assistant/data/clients.py +0 -8
  12. pygeai/assistant/data_analyst/clients.py +0 -2
  13. pygeai/assistant/managers.py +1 -1
  14. pygeai/assistant/rag/clients.py +0 -2
  15. pygeai/assistant/rag/mappers.py +9 -11
  16. pygeai/auth/clients.py +26 -7
  17. pygeai/auth/endpoints.py +2 -1
  18. pygeai/chat/clients.py +2 -2
  19. pygeai/chat/managers.py +1 -1
  20. pygeai/cli/commands/admin.py +13 -25
  21. pygeai/cli/commands/analytics.py +31 -71
  22. pygeai/cli/commands/assistant.py +84 -138
  23. pygeai/cli/commands/auth.py +23 -46
  24. pygeai/cli/commands/base.py +0 -1
  25. pygeai/cli/commands/chat.py +218 -209
  26. pygeai/cli/commands/common.py +5 -5
  27. pygeai/cli/commands/configuration.py +79 -29
  28. pygeai/cli/commands/docs.py +3 -4
  29. pygeai/cli/commands/embeddings.py +13 -19
  30. pygeai/cli/commands/evaluation.py +133 -344
  31. pygeai/cli/commands/feedback.py +7 -15
  32. pygeai/cli/commands/files.py +26 -53
  33. pygeai/cli/commands/gam.py +28 -69
  34. pygeai/cli/commands/lab/ai_lab.py +96 -142
  35. pygeai/cli/commands/lab/common.py +1 -1
  36. pygeai/cli/commands/lab/spec.py +12 -32
  37. pygeai/cli/commands/llm.py +9 -18
  38. pygeai/cli/commands/migrate.py +43 -99
  39. pygeai/cli/commands/organization.py +223 -196
  40. pygeai/cli/commands/rag.py +35 -58
  41. pygeai/cli/commands/rerank.py +21 -25
  42. pygeai/cli/commands/secrets.py +39 -67
  43. pygeai/cli/commands/usage_limits.py +50 -136
  44. pygeai/cli/commands/validators.py +1 -1
  45. pygeai/cli/geai.py +32 -3
  46. pygeai/cli/geai_proxy.py +6 -2
  47. pygeai/cli/install_man.py +1 -1
  48. pygeai/cli/parsers.py +1 -1
  49. pygeai/core/base/clients.py +90 -21
  50. pygeai/core/base/mappers.py +39 -55
  51. pygeai/core/base/session.py +129 -18
  52. pygeai/core/common/config.py +50 -13
  53. pygeai/core/common/constants.py +8 -0
  54. pygeai/core/common/exceptions.py +6 -0
  55. pygeai/core/embeddings/clients.py +0 -1
  56. pygeai/core/embeddings/managers.py +0 -1
  57. pygeai/core/feedback/clients.py +0 -2
  58. pygeai/core/feedback/models.py +1 -1
  59. pygeai/core/files/clients.py +0 -3
  60. pygeai/core/files/managers.py +1 -1
  61. pygeai/core/files/mappers.py +4 -5
  62. pygeai/core/llm/clients.py +0 -1
  63. pygeai/core/models.py +4 -4
  64. pygeai/core/plugins/clients.py +0 -3
  65. pygeai/core/plugins/models.py +2 -2
  66. pygeai/core/rerank/clients.py +0 -2
  67. pygeai/core/secrets/clients.py +0 -2
  68. pygeai/core/services/rest.py +80 -14
  69. pygeai/core/singleton.py +24 -0
  70. pygeai/dbg/__init__.py +2 -2
  71. pygeai/dbg/debugger.py +276 -38
  72. pygeai/evaluation/clients.py +2 -4
  73. pygeai/evaluation/dataset/clients.py +0 -1
  74. pygeai/evaluation/plan/clients.py +0 -2
  75. pygeai/evaluation/result/clients.py +0 -2
  76. pygeai/gam/clients.py +1 -3
  77. pygeai/health/clients.py +1 -3
  78. pygeai/lab/clients.py +0 -1
  79. pygeai/lab/managers.py +0 -1
  80. pygeai/lab/models.py +0 -1
  81. pygeai/lab/strategies/clients.py +1 -2
  82. pygeai/lab/tools/clients.py +2 -2
  83. pygeai/lab/tools/mappers.py +1 -1
  84. pygeai/migration/strategies.py +5 -6
  85. pygeai/migration/tools.py +1 -1
  86. pygeai/organization/clients.py +118 -12
  87. pygeai/organization/endpoints.py +1 -0
  88. pygeai/organization/limits/clients.py +4 -6
  89. pygeai/organization/limits/managers.py +1 -4
  90. pygeai/organization/managers.py +2 -2
  91. pygeai/proxy/config.py +1 -0
  92. pygeai/proxy/managers.py +6 -5
  93. pygeai/tests/admin/test_clients.py +11 -11
  94. pygeai/tests/assistants/rag/test_clients.py +1 -1
  95. pygeai/tests/assistants/rag/test_models.py +1 -2
  96. pygeai/tests/assistants/test_clients.py +1 -1
  97. pygeai/tests/assistants/test_managers.py +1 -3
  98. pygeai/tests/auth/test_cli_configuration.py +252 -0
  99. pygeai/tests/auth/test_client_initialization.py +411 -0
  100. pygeai/tests/auth/test_clients.py +29 -27
  101. pygeai/tests/auth/test_config_manager.py +305 -0
  102. pygeai/tests/auth/test_header_injection.py +294 -0
  103. pygeai/tests/auth/test_oauth.py +3 -1
  104. pygeai/tests/auth/test_session_logging.py +119 -0
  105. pygeai/tests/auth/test_session_validation.py +408 -0
  106. pygeai/tests/auth/test_singleton_reset.py +201 -0
  107. pygeai/tests/chat/test_clients.py +1 -1
  108. pygeai/tests/chat/test_iris.py +1 -1
  109. pygeai/tests/chat/test_ui.py +0 -2
  110. pygeai/tests/cli/commands/lab/test_ai_lab.py +1 -3
  111. pygeai/tests/cli/commands/lab/test_common.py +0 -1
  112. pygeai/tests/cli/commands/test_chat.py +1 -1
  113. pygeai/tests/cli/commands/test_common.py +0 -1
  114. pygeai/tests/cli/commands/test_embeddings.py +2 -2
  115. pygeai/tests/cli/commands/test_evaluation.py +1 -9
  116. pygeai/tests/cli/commands/test_llm.py +1 -1
  117. pygeai/tests/cli/commands/test_migrate.py +1 -1
  118. pygeai/tests/cli/commands/test_rerank.py +0 -1
  119. pygeai/tests/cli/commands/test_secrets.py +1 -1
  120. pygeai/tests/cli/commands/test_show_help.py +0 -1
  121. pygeai/tests/cli/commands/test_validators.py +0 -1
  122. pygeai/tests/cli/test_credentials_flag.py +312 -0
  123. pygeai/tests/cli/test_error_handler.py +0 -1
  124. pygeai/tests/core/base/test_mappers.py +2 -2
  125. pygeai/tests/core/base/test_models.py +4 -4
  126. pygeai/tests/core/common/test_config.py +2 -7
  127. pygeai/tests/core/common/test_decorators.py +0 -1
  128. pygeai/tests/core/embeddings/test_managers.py +1 -1
  129. pygeai/tests/core/feedback/test_clients.py +2 -2
  130. pygeai/tests/core/files/test_clients.py +6 -6
  131. pygeai/tests/core/files/test_models.py +0 -1
  132. pygeai/tests/core/files/test_responses.py +0 -1
  133. pygeai/tests/core/llm/test_clients.py +1 -1
  134. pygeai/tests/core/plugins/test_clients.py +4 -4
  135. pygeai/tests/core/rerank/test_mappers.py +1 -3
  136. pygeai/tests/core/secrets/test_clients.py +2 -3
  137. pygeai/tests/core/services/test_rest.py +10 -10
  138. pygeai/tests/core/utils/test_console.py +0 -1
  139. pygeai/tests/dbg/test_debugger.py +95 -8
  140. pygeai/tests/evaluation/dataset/test_clients.py +24 -27
  141. pygeai/tests/evaluation/plan/test_clients.py +16 -18
  142. pygeai/tests/evaluation/result/test_clients.py +4 -5
  143. pygeai/tests/health/test_clients.py +2 -2
  144. pygeai/tests/integration/lab/agents/test_create_agent.py +1 -3
  145. pygeai/tests/integration/lab/agents/test_get_agent.py +1 -1
  146. pygeai/tests/integration/lab/processes/test_create_process.py +2 -2
  147. pygeai/tests/integration/lab/processes/test_create_task.py +2 -3
  148. pygeai/tests/integration/lab/processes/test_delete_process.py +0 -1
  149. pygeai/tests/integration/lab/processes/test_get_process.py +2 -4
  150. pygeai/tests/integration/lab/processes/test_list_process_instances.py +1 -3
  151. pygeai/tests/integration/lab/processes/test_update_process.py +3 -9
  152. pygeai/tests/integration/lab/reasoning_strategies/test_update_reasoning_strategy.py +1 -2
  153. pygeai/tests/integration/lab/tools/test_delete_tool.py +1 -1
  154. pygeai/tests/integration/lab/tools/test_list_tools.py +1 -1
  155. pygeai/tests/integration/lab/tools/test_update_tool.py +1 -1
  156. pygeai/tests/lab/agents/test_clients.py +17 -17
  157. pygeai/tests/lab/processes/test_clients.py +67 -67
  158. pygeai/tests/lab/processes/test_mappers.py +23 -23
  159. pygeai/tests/lab/spec/test_loader.py +0 -2
  160. pygeai/tests/lab/spec/test_parsers.py +1 -2
  161. pygeai/tests/lab/strategies/test_clients.py +10 -10
  162. pygeai/tests/lab/test_managers.py +3 -5
  163. pygeai/tests/lab/test_mappers.py +1 -4
  164. pygeai/tests/lab/tools/test_clients.py +21 -21
  165. pygeai/tests/lab/tools/test_mappers.py +0 -1
  166. pygeai/tests/organization/limits/test_clients.py +33 -33
  167. pygeai/tests/organization/limits/test_managers.py +7 -7
  168. pygeai/tests/organization/test_clients.py +78 -60
  169. pygeai/tests/proxy/test_clients.py +1 -1
  170. pygeai/tests/proxy/test_integration.py +1 -4
  171. pygeai/tests/proxy/test_managers.py +1 -2
  172. pygeai/tests/proxy/test_servers.py +1 -2
  173. pygeai/tests/snippets/assistants/rag/delete_rag_assistant.py +0 -1
  174. pygeai/tests/snippets/assistants/rag/get_documents.py +0 -1
  175. pygeai/tests/snippets/assistants/rag/get_rag_assistant_data.py +0 -1
  176. pygeai/tests/snippets/chat/get_request_status.py +0 -1
  177. pygeai/tests/snippets/dbg/file_debugging.py +72 -0
  178. pygeai/tests/snippets/dbg/module_debugging.py +60 -0
  179. pygeai/tests/snippets/embeddings/cohere_example.py +2 -2
  180. pygeai/tests/snippets/embeddings/openai_base64_example.py +1 -1
  181. pygeai/tests/snippets/evaluation/dataset/complete_workflow_example.py +8 -8
  182. pygeai/tests/snippets/evaluation/plan/complete_workflow_example.py +5 -5
  183. pygeai/tests/snippets/evaluation/result/complete_workflow_example.py +3 -3
  184. pygeai/tests/snippets/lab/agentic_flow_example_1.py +1 -1
  185. pygeai/tests/snippets/lab/agentic_flow_example_2.py +3 -4
  186. pygeai/tests/snippets/lab/agents/create_agent_with_permissions.py +2 -2
  187. pygeai/tests/snippets/lab/agents/delete_agent.py +1 -2
  188. pygeai/tests/snippets/lab/agents/get_agent.py +1 -1
  189. pygeai/tests/snippets/lab/agents/get_agent_with_new_fields.py +10 -10
  190. pygeai/tests/snippets/lab/agents/get_sharing_link.py +0 -1
  191. pygeai/tests/snippets/lab/agents/list_agents.py +1 -1
  192. pygeai/tests/snippets/lab/agents/publish_agent_revision.py +0 -1
  193. pygeai/tests/snippets/lab/agents/update_agent_properties.py +1 -1
  194. pygeai/tests/snippets/lab/crud_ui.py +3 -5
  195. pygeai/tests/snippets/lab/processes/kbs/get_kb.py +0 -1
  196. pygeai/tests/snippets/lab/processes/kbs/list_kbs.py +0 -1
  197. pygeai/tests/snippets/lab/processes/list_processes.py +1 -1
  198. pygeai/tests/snippets/lab/samples/summarize_files.py +0 -3
  199. pygeai/tests/snippets/lab/strategies/get_reasoning_strategy.py +0 -1
  200. pygeai/tests/snippets/lab/strategies/list_reasoning_strategies.py +1 -1
  201. pygeai/tests/snippets/lab/tools/get_tool.py +1 -1
  202. pygeai/tests/snippets/lab/tools/publish_tool_revision.py +0 -1
  203. pygeai/tests/snippets/lab/tools/set_parameters.py +1 -2
  204. pygeai/tests/snippets/lab/use_cases/c_code_fixer_agent_flow.py +2 -3
  205. pygeai/tests/snippets/lab/use_cases/file_summarizer_example_2.py +1 -1
  206. pygeai/tests/snippets/lab/use_cases/update_cli_expert.py +0 -1
  207. pygeai/tests/snippets/lab/use_cases/update_lab_expert.py +0 -1
  208. pygeai/tests/snippets/lab/use_cases/update_web_designer.py +0 -1
  209. pygeai/tests/snippets/lab/use_cases/update_web_reader.py +0 -1
  210. pygeai/tests/snippets/migrate/orchestrator_examples.py +1 -1
  211. {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/METADATA +32 -7
  212. {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/RECORD +216 -205
  213. {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/WHEEL +0 -0
  214. {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/entry_points.txt +0 -0
  215. {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/licenses/LICENSE +0 -0
  216. {pygeai-0.6.0b14.dist-info → pygeai-0.7.0b1.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,8 @@
1
1
  from unittest import TestCase
2
- import unittest
3
2
  import uuid
4
3
  from pygeai.lab.managers import AILabManager
5
- from pygeai.lab.models import Task, Prompt, ArtifactTypeList, ArtifactType
6
- from pygeai.core.common.exceptions import APIResponseError, APIError
4
+ from pygeai.lab.models import Task, Prompt
5
+ from pygeai.core.common.exceptions import APIError
7
6
 
8
7
 
9
8
  class TestAILabCreateTaskIntegration(TestCase):
@@ -3,7 +3,6 @@ import uuid
3
3
  from pygeai.lab.managers import AILabManager
4
4
  from pygeai.lab.models import AgenticProcess, KnowledgeBase, AgenticActivity, ArtifactSignal, UserSignal, Event, SequenceFlow
5
5
  from pygeai.core.common.exceptions import InvalidAPIResponseException, MissingRequirementException
6
- from pygeai.core.base.responses import EmptyResponse
7
6
 
8
7
  ai_lab_manager: AILabManager
9
8
 
@@ -1,10 +1,8 @@
1
1
  from unittest import TestCase
2
- import unittest
3
2
  from pygeai.lab.managers import AILabManager
4
- from pygeai.lab.models import AgenticProcess, FilterSettings, KnowledgeBase, AgenticActivity, ArtifactSignal, UserSignal, Event, SequenceFlow
5
- from pygeai.core.common.exceptions import APIResponseError, APIError, MissingRequirementException
3
+ from pygeai.lab.models import AgenticProcess, FilterSettings
4
+ from pygeai.core.common.exceptions import APIError, MissingRequirementException
6
5
  import copy
7
- import uuid
8
6
 
9
7
 
10
8
  class TestAILabGetProcessIntegration(TestCase):
@@ -1,8 +1,6 @@
1
1
  from unittest import TestCase
2
- import uuid
3
2
  from pygeai.lab.managers import AILabManager
4
- from pygeai.lab.models import FilterSettings, ProcessInstanceList, AgenticProcess, KnowledgeBase, AgenticActivity, ArtifactSignal, UserSignal, Event, SequenceFlow
5
- from pygeai.core.common.exceptions import APIError, MissingRequirementException
3
+ from pygeai.lab.models import FilterSettings, ProcessInstanceList
6
4
  import copy
7
5
 
8
6
  ai_lab_manager: AILabManager
@@ -1,12 +1,11 @@
1
1
  from unittest import TestCase
2
2
  import uuid
3
3
 
4
- from pydantic import ValidationError
5
- from pygeai.core.common.exceptions import APIResponseError, APIError
4
+ from pygeai.core.common.exceptions import APIError
6
5
  from pygeai.lab.managers import AILabManager
7
6
  from pygeai.lab.models import (
8
7
  AgenticProcess, KnowledgeBase, AgenticActivity, ArtifactSignal, Task,
9
- UserSignal, Event, SequenceFlow, Variable
8
+ UserSignal, Event, SequenceFlow
10
9
  )
11
10
 
12
11
 
@@ -20,7 +19,6 @@ class TestAILabUpdateProcessIntegration(TestCase):
20
19
  self.created_process: AgenticProcess = None
21
20
  self.updated_process: AgenticProcess = None
22
21
 
23
-
24
22
  def tearDown(self):
25
23
  """
26
24
  Clean up after each test if necessary.
@@ -29,7 +27,6 @@ class TestAILabUpdateProcessIntegration(TestCase):
29
27
  if isinstance(self.created_process, AgenticProcess):
30
28
  self.ai_lab_manager.delete_process(self.created_process.id)
31
29
 
32
-
33
30
  def __load_process(self):
34
31
  """
35
32
  Helper to load a complete process configuration for testing.
@@ -137,12 +134,11 @@ class TestAILabUpdateProcessIntegration(TestCase):
137
134
  self.__update_process(automatic_publish=auto_publish)
138
135
 
139
136
  self.assertIn(
140
- f"Invalid character in name ({':' if ":" in invalid_name else "/"} is not allowed).",
137
+ f"Invalid character in name ({':' if ':' in invalid_name else '/'} is not allowed).",
141
138
  str(exception.exception),
142
139
  f"Expected an error about invalid character in process name with autopublish {'enabled' if auto_publish else 'disabled'}"
143
140
  )
144
141
 
145
-
146
142
  def test_update_process_duplicated_name(self):
147
143
  """
148
144
  Test updating a process with a name that already exists.
@@ -161,7 +157,6 @@ class TestAILabUpdateProcessIntegration(TestCase):
161
157
  str(exception.exception),
162
158
  f"Expected an error about duplicated process name with autopublish {'enabled' if auto_publish else 'disabled'}"
163
159
  )
164
-
165
160
 
166
161
  def test_update_process_no_name(self):
167
162
  """
@@ -182,7 +177,6 @@ class TestAILabUpdateProcessIntegration(TestCase):
182
177
  f"Expected an error when process name is empty with autopublish {'enabled' if auto_publish else 'disabled'}"
183
178
  )
184
179
 
185
-
186
180
  def test_update_process_invalid_id(self):
187
181
  """
188
182
  Test updating a process with an invalid ID.
@@ -3,8 +3,7 @@ import unittest
3
3
  import uuid
4
4
  from pygeai.lab.managers import AILabManager
5
5
  from pygeai.lab.models import LocalizedDescription, ReasoningStrategy
6
- from pydantic import ValidationError
7
- from pygeai.core.common.exceptions import APIError, APIResponseError
6
+ from pygeai.core.common.exceptions import APIError
8
7
 
9
8
  class TestAILabCreateReasoningStrategyIntegration(TestCase):
10
9
  def setUp(self):
@@ -2,7 +2,7 @@ from unittest import TestCase
2
2
  import uuid
3
3
  from pygeai.lab.managers import AILabManager
4
4
  from pygeai.lab.models import Tool
5
- from pygeai.core.common.exceptions import APIResponseError, MissingRequirementException, InvalidAPIResponseException
5
+ from pygeai.core.common.exceptions import APIResponseError, MissingRequirementException
6
6
 
7
7
  ai_lab_manager: AILabManager
8
8
 
@@ -91,7 +91,7 @@ class TestAILabListToolsIntegration(TestCase):
91
91
  self.assertIn(
92
92
  "Scope must be one of builtin, external, api, proxied.",
93
93
  str(exception.exception),
94
- f"The expected error about invalid scope was not returned"
94
+ "The expected error about invalid scope was not returned"
95
95
  )
96
96
 
97
97
 
@@ -148,7 +148,7 @@ class TestAILabUpdateToolIntegration(TestCase):
148
148
  with self.assertRaises(ValueError) as exception:
149
149
  self.__update_tool(automatic_publish=auto_publish)
150
150
  self.assertIn(
151
- f"Scope must be one of builtin, external, api, proxied",
151
+ "Scope must be one of builtin, external, api, proxied",
152
152
  str(exception.exception),
153
153
  f"Expected an error when tool scope is invalid and autopublish {'enabled' if auto_publish else 'disabled'}"
154
154
  )
@@ -24,7 +24,7 @@ class TestAgentClient(unittest.TestCase):
24
24
  self.agent_data_models = [{"name": "gpt-4o"}]
25
25
  self.agent_data_resource_pools = [{"name": "pool1", "tools": [{"name": "tool1"}]}]
26
26
 
27
- @patch("pygeai.core.services.rest.ApiService.get")
27
+ @patch("pygeai.core.services.rest.GEAIApiService.get")
28
28
  def test_list_agents_success(self, mock_get):
29
29
  expected_response = {"agents": [{"id": "agent-1", "name": "Agent1"}]}
30
30
  mock_response = mock_get.return_value
@@ -56,7 +56,7 @@ class TestAgentClient(unittest.TestCase):
56
56
  headers = mock_get.call_args[1]['headers']
57
57
  self.assertEqual(headers['ProjectId'], self.project_id)
58
58
 
59
- @patch("pygeai.core.services.rest.ApiService.get")
59
+ @patch("pygeai.core.services.rest.GEAIApiService.get")
60
60
  def test_list_agents_json_decode_error(self, mock_get):
61
61
  mock_response = mock_get.return_value
62
62
  mock_response.status_code = 200
@@ -69,7 +69,7 @@ class TestAgentClient(unittest.TestCase):
69
69
  self.assertEqual(str(context.exception), f"Unable to list agents for project {self.project_id}: Invalid JSON response")
70
70
  mock_get.assert_called_once()
71
71
 
72
- @patch("pygeai.core.services.rest.ApiService.post")
72
+ @patch("pygeai.core.services.rest.GEAIApiService.post")
73
73
  def test_create_agent_success(self, mock_post):
74
74
  expected_response = {"id": "agent-123", "name": "Test Agent"}
75
75
  mock_response = mock_post.return_value
@@ -111,7 +111,7 @@ class TestAgentClient(unittest.TestCase):
111
111
  headers = mock_post.call_args[1]['headers']
112
112
  self.assertEqual(headers['ProjectId'], self.project_id)
113
113
 
114
- @patch("pygeai.core.services.rest.ApiService.post")
114
+ @patch("pygeai.core.services.rest.GEAIApiService.post")
115
115
  def test_create_agent_without_resource_pools(self, mock_post):
116
116
  expected_response = {"id": "agent-123", "name": "Test Agent"}
117
117
  mock_response = mock_post.return_value
@@ -153,7 +153,7 @@ class TestAgentClient(unittest.TestCase):
153
153
  )
154
154
  self.assertEqual(str(context.exception), f"Access scope must be one of {', '.join(VALID_ACCESS_SCOPES)}.")
155
155
 
156
- @patch("pygeai.core.services.rest.ApiService.post")
156
+ @patch("pygeai.core.services.rest.GEAIApiService.post")
157
157
  def test_create_agent_json_decode_error(self, mock_post):
158
158
  mock_response = mock_post.return_value
159
159
  mock_response.status_code = 200
@@ -177,7 +177,7 @@ class TestAgentClient(unittest.TestCase):
177
177
  self.assertEqual(str(context.exception), f"Unable to create agent for project {self.project_id}: Invalid JSON response")
178
178
  mock_post.assert_called_once()
179
179
 
180
- @patch("pygeai.core.services.rest.ApiService.get")
180
+ @patch("pygeai.core.services.rest.GEAIApiService.get")
181
181
  def test_get_agent_success(self, mock_get):
182
182
  expected_response = {"id": self.agent_id, "name": "Test Agent"}
183
183
  mock_response = mock_get.return_value
@@ -209,7 +209,7 @@ class TestAgentClient(unittest.TestCase):
209
209
  self.client.get_agent(agent_id="")
210
210
  self.assertEqual(str(context.exception), "agent_id must be specified in order to retrieve the agent")
211
211
 
212
- @patch("pygeai.core.services.rest.ApiService.get")
212
+ @patch("pygeai.core.services.rest.GEAIApiService.get")
213
213
  def test_get_agent_json_decode_error(self, mock_get):
214
214
  mock_response = mock_get.return_value
215
215
  mock_response.status_code = 200
@@ -222,7 +222,7 @@ class TestAgentClient(unittest.TestCase):
222
222
  self.assertEqual(str(context.exception), f"Unable to retrieve agent {self.agent_id} for project {self.project_id}: Invalid JSON response")
223
223
  mock_get.assert_called_once()
224
224
 
225
- @patch("pygeai.core.services.rest.ApiService.get")
225
+ @patch("pygeai.core.services.rest.GEAIApiService.get")
226
226
  def test_create_sharing_link_success(self, mock_get):
227
227
  expected_response = {"link": "http://example.com/share"}
228
228
  mock_response = mock_get.return_value
@@ -247,7 +247,7 @@ class TestAgentClient(unittest.TestCase):
247
247
  self.client.create_sharing_link(agent_id="")
248
248
  self.assertEqual(str(context.exception), "agent_id must be specified in order to create sharing link")
249
249
 
250
- @patch("pygeai.core.services.rest.ApiService.get")
250
+ @patch("pygeai.core.services.rest.GEAIApiService.get")
251
251
  def test_create_sharing_link_json_decode_error(self, mock_get):
252
252
  mock_response = mock_get.return_value
253
253
  mock_response.status_code = 200
@@ -262,7 +262,7 @@ class TestAgentClient(unittest.TestCase):
262
262
  self.assertEqual(str(context.exception), f"Unable to create sharing link for agent {self.agent_id} in project {self.project_id}: Invalid JSON response")
263
263
  mock_get.assert_called_once()
264
264
 
265
- @patch("pygeai.core.services.rest.ApiService.post")
265
+ @patch("pygeai.core.services.rest.GEAIApiService.post")
266
266
  def test_publish_agent_revision_success(self, mock_post):
267
267
  revision = "2"
268
268
  expected_response = {"status": "published"}
@@ -284,7 +284,7 @@ class TestAgentClient(unittest.TestCase):
284
284
  headers = mock_post.call_args[1]['headers']
285
285
  self.assertEqual(headers['ProjectId'], self.project_id)
286
286
 
287
- @patch("pygeai.core.services.rest.ApiService.post")
287
+ @patch("pygeai.core.services.rest.GEAIApiService.post")
288
288
  def test_publish_agent_revision_json_decode_error(self, mock_post):
289
289
  revision = "2"
290
290
  mock_response = mock_post.return_value
@@ -301,7 +301,7 @@ class TestAgentClient(unittest.TestCase):
301
301
  self.assertEqual(str(context.exception), f"Unable to publish revision {revision} for agent {self.agent_id} in project {self.project_id}: Invalid JSON response")
302
302
  mock_post.assert_called_once()
303
303
 
304
- @patch("pygeai.core.services.rest.ApiService.delete")
304
+ @patch("pygeai.core.services.rest.GEAIApiService.delete")
305
305
  def test_delete_agent_success(self, mock_delete):
306
306
  expected_response = {}
307
307
  mock_response = mock_delete.return_value
@@ -320,7 +320,7 @@ class TestAgentClient(unittest.TestCase):
320
320
  headers = mock_delete.call_args[1]['headers']
321
321
  self.assertEqual(headers['ProjectId'], self.project_id)
322
322
 
323
- @patch("pygeai.core.services.rest.ApiService.delete")
323
+ @patch("pygeai.core.services.rest.GEAIApiService.delete")
324
324
  def test_delete_agent_json_decode_error(self, mock_delete):
325
325
  mock_response = mock_delete.return_value
326
326
  mock_response.status_code = 200
@@ -335,7 +335,7 @@ class TestAgentClient(unittest.TestCase):
335
335
  self.assertEqual(str(context.exception), f"Unable to delete agent {self.agent_id} from project {self.project_id}: Invalid JSON response")
336
336
  mock_delete.assert_called_once()
337
337
 
338
- @patch("pygeai.core.services.rest.ApiService.put")
338
+ @patch("pygeai.core.services.rest.GEAIApiService.put")
339
339
  def test_update_agent_success(self, mock_put):
340
340
  expected_response = {"id": self.agent_id, "name": "Updated Agent"}
341
341
  mock_response = mock_put.return_value
@@ -379,7 +379,7 @@ class TestAgentClient(unittest.TestCase):
379
379
  headers = mock_put.call_args[1]['headers']
380
380
  self.assertEqual(headers['ProjectId'], self.project_id)
381
381
 
382
- @patch("pygeai.core.services.rest.ApiService.put")
382
+ @patch("pygeai.core.services.rest.GEAIApiService.put")
383
383
  def test_update_agent_with_upsert(self, mock_put):
384
384
  expected_response = {"id": self.agent_id, "name": "Upserted Agent"}
385
385
  mock_response = mock_put.return_value
@@ -409,7 +409,7 @@ class TestAgentClient(unittest.TestCase):
409
409
  data=mock_put.call_args[1]['data']
410
410
  )
411
411
 
412
- @patch("pygeai.core.services.rest.ApiService.put")
412
+ @patch("pygeai.core.services.rest.GEAIApiService.put")
413
413
  def test_update_agent_without_resource_pools(self, mock_put):
414
414
  expected_response = {"id": self.agent_id, "name": "Updated Agent No Pools"}
415
415
  mock_response = mock_put.return_value
@@ -454,7 +454,7 @@ class TestAgentClient(unittest.TestCase):
454
454
  )
455
455
  self.assertEqual(str(context.exception), f"Access scope must be one of {', '.join(VALID_ACCESS_SCOPES)}.")
456
456
 
457
- @patch("pygeai.core.services.rest.ApiService.put")
457
+ @patch("pygeai.core.services.rest.GEAIApiService.put")
458
458
  def test_update_agent_json_decode_error(self, mock_put):
459
459
  mock_response = mock_put.return_value
460
460
  mock_response.status_code = 200