pygeai 0.6.0b7__py3-none-any.whl → 0.6.0b10__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 (178) hide show
  1. pygeai/_docs/source/conf.py +78 -6
  2. pygeai/_docs/source/content/api_reference/embeddings.rst +31 -1
  3. pygeai/_docs/source/content/api_reference/evaluation.rst +590 -0
  4. pygeai/_docs/source/content/api_reference/feedback.rst +237 -0
  5. pygeai/_docs/source/content/api_reference/files.rst +592 -0
  6. pygeai/_docs/source/content/api_reference/gam.rst +401 -0
  7. pygeai/_docs/source/content/api_reference/proxy.rst +318 -0
  8. pygeai/_docs/source/content/api_reference/secrets.rst +495 -0
  9. pygeai/_docs/source/content/api_reference/usage_limits.rst +390 -0
  10. pygeai/_docs/source/content/api_reference.rst +7 -0
  11. pygeai/_docs/source/content/debugger.rst +376 -83
  12. pygeai/_docs/source/content/migration.rst +528 -0
  13. pygeai/_docs/source/content/modules.rst +1 -1
  14. pygeai/_docs/source/pygeai.cli.rst +8 -0
  15. pygeai/_docs/source/pygeai.tests.cli.rst +16 -0
  16. pygeai/_docs/source/pygeai.tests.core.embeddings.rst +16 -0
  17. pygeai/_docs/source/pygeai.tests.snippets.chat.rst +40 -0
  18. pygeai/_docs/source/pygeai.tests.snippets.dbg.rst +45 -0
  19. pygeai/_docs/source/pygeai.tests.snippets.embeddings.rst +40 -0
  20. pygeai/_docs/source/pygeai.tests.snippets.evaluation.dataset.rst +197 -0
  21. pygeai/_docs/source/pygeai.tests.snippets.evaluation.plan.rst +133 -0
  22. pygeai/_docs/source/pygeai.tests.snippets.evaluation.result.rst +37 -0
  23. pygeai/_docs/source/pygeai.tests.snippets.evaluation.rst +10 -0
  24. pygeai/_docs/source/pygeai.tests.snippets.rst +1 -0
  25. pygeai/admin/clients.py +5 -0
  26. pygeai/assistant/clients.py +7 -0
  27. pygeai/assistant/data_analyst/clients.py +2 -0
  28. pygeai/assistant/rag/clients.py +11 -0
  29. pygeai/chat/clients.py +191 -25
  30. pygeai/chat/endpoints.py +2 -1
  31. pygeai/cli/commands/chat.py +227 -1
  32. pygeai/cli/commands/embeddings.py +56 -8
  33. pygeai/cli/commands/migrate.py +994 -434
  34. pygeai/cli/error_handler.py +116 -0
  35. pygeai/cli/geai.py +28 -10
  36. pygeai/cli/parsers.py +8 -2
  37. pygeai/core/base/clients.py +3 -1
  38. pygeai/core/common/exceptions.py +11 -10
  39. pygeai/core/embeddings/__init__.py +19 -0
  40. pygeai/core/embeddings/clients.py +17 -2
  41. pygeai/core/embeddings/mappers.py +16 -2
  42. pygeai/core/embeddings/responses.py +9 -2
  43. pygeai/core/feedback/clients.py +1 -0
  44. pygeai/core/files/clients.py +5 -7
  45. pygeai/core/files/managers.py +42 -0
  46. pygeai/core/llm/clients.py +4 -0
  47. pygeai/core/plugins/clients.py +1 -0
  48. pygeai/core/rerank/clients.py +1 -0
  49. pygeai/core/secrets/clients.py +6 -0
  50. pygeai/core/services/rest.py +1 -1
  51. pygeai/dbg/__init__.py +3 -0
  52. pygeai/dbg/debugger.py +565 -70
  53. pygeai/evaluation/clients.py +1 -1
  54. pygeai/evaluation/dataset/clients.py +45 -44
  55. pygeai/evaluation/plan/clients.py +27 -26
  56. pygeai/evaluation/result/clients.py +37 -5
  57. pygeai/gam/clients.py +4 -0
  58. pygeai/health/clients.py +1 -0
  59. pygeai/lab/agents/clients.py +8 -1
  60. pygeai/lab/models.py +3 -3
  61. pygeai/lab/processes/clients.py +21 -0
  62. pygeai/lab/strategies/clients.py +4 -0
  63. pygeai/lab/tools/clients.py +1 -0
  64. pygeai/migration/__init__.py +31 -0
  65. pygeai/migration/strategies.py +404 -155
  66. pygeai/migration/tools.py +170 -3
  67. pygeai/organization/clients.py +13 -0
  68. pygeai/organization/limits/clients.py +15 -0
  69. pygeai/proxy/clients.py +3 -1
  70. pygeai/tests/admin/test_clients.py +16 -11
  71. pygeai/tests/assistants/rag/test_clients.py +35 -23
  72. pygeai/tests/assistants/test_clients.py +22 -15
  73. pygeai/tests/auth/test_clients.py +14 -6
  74. pygeai/tests/chat/test_clients.py +211 -1
  75. pygeai/tests/cli/commands/test_embeddings.py +32 -9
  76. pygeai/tests/cli/commands/test_evaluation.py +7 -0
  77. pygeai/tests/cli/commands/test_migrate.py +112 -243
  78. pygeai/tests/cli/test_error_handler.py +225 -0
  79. pygeai/tests/cli/test_geai_driver.py +154 -0
  80. pygeai/tests/cli/test_parsers.py +5 -5
  81. pygeai/tests/core/embeddings/test_clients.py +144 -0
  82. pygeai/tests/core/embeddings/test_managers.py +171 -0
  83. pygeai/tests/core/embeddings/test_mappers.py +142 -0
  84. pygeai/tests/core/feedback/test_clients.py +2 -0
  85. pygeai/tests/core/files/test_clients.py +1 -0
  86. pygeai/tests/core/llm/test_clients.py +14 -9
  87. pygeai/tests/core/plugins/test_clients.py +5 -3
  88. pygeai/tests/core/rerank/test_clients.py +1 -0
  89. pygeai/tests/core/secrets/test_clients.py +19 -13
  90. pygeai/tests/dbg/test_debugger.py +453 -75
  91. pygeai/tests/evaluation/dataset/test_clients.py +3 -1
  92. pygeai/tests/evaluation/plan/test_clients.py +4 -2
  93. pygeai/tests/evaluation/result/test_clients.py +7 -5
  94. pygeai/tests/gam/test_clients.py +1 -1
  95. pygeai/tests/health/test_clients.py +1 -0
  96. pygeai/tests/lab/agents/test_clients.py +9 -0
  97. pygeai/tests/lab/processes/test_clients.py +36 -0
  98. pygeai/tests/lab/processes/test_mappers.py +3 -0
  99. pygeai/tests/lab/strategies/test_clients.py +14 -9
  100. pygeai/tests/migration/test_strategies.py +45 -218
  101. pygeai/tests/migration/test_tools.py +133 -9
  102. pygeai/tests/organization/limits/test_clients.py +17 -0
  103. pygeai/tests/organization/test_clients.py +22 -0
  104. pygeai/tests/proxy/test_clients.py +2 -0
  105. pygeai/tests/proxy/test_integration.py +1 -0
  106. pygeai/tests/snippets/chat/chat_completion_with_reasoning_effort.py +18 -0
  107. pygeai/tests/snippets/chat/get_response.py +15 -0
  108. pygeai/tests/snippets/chat/get_response_streaming.py +20 -0
  109. pygeai/tests/snippets/chat/get_response_with_files.py +16 -0
  110. pygeai/tests/snippets/chat/get_response_with_tools.py +36 -0
  111. pygeai/tests/snippets/dbg/__init__.py +0 -0
  112. pygeai/tests/snippets/dbg/basic_debugging.py +32 -0
  113. pygeai/tests/snippets/dbg/breakpoint_management.py +48 -0
  114. pygeai/tests/snippets/dbg/stack_navigation.py +45 -0
  115. pygeai/tests/snippets/dbg/stepping_example.py +40 -0
  116. pygeai/tests/snippets/embeddings/cache_example.py +31 -0
  117. pygeai/tests/snippets/embeddings/cohere_example.py +41 -0
  118. pygeai/tests/snippets/embeddings/openai_base64_example.py +27 -0
  119. pygeai/tests/snippets/embeddings/openai_example.py +30 -0
  120. pygeai/tests/snippets/embeddings/similarity_example.py +42 -0
  121. pygeai/tests/snippets/evaluation/dataset/__init__.py +0 -0
  122. pygeai/tests/snippets/evaluation/dataset/complete_workflow_example.py +195 -0
  123. pygeai/tests/snippets/evaluation/dataset/create_dataset.py +26 -0
  124. pygeai/tests/snippets/evaluation/dataset/create_dataset_from_file.py +11 -0
  125. pygeai/tests/snippets/evaluation/dataset/create_dataset_row.py +17 -0
  126. pygeai/tests/snippets/evaluation/dataset/create_expected_source.py +18 -0
  127. pygeai/tests/snippets/evaluation/dataset/create_filter_variable.py +19 -0
  128. pygeai/tests/snippets/evaluation/dataset/delete_dataset.py +9 -0
  129. pygeai/tests/snippets/evaluation/dataset/delete_dataset_row.py +10 -0
  130. pygeai/tests/snippets/evaluation/dataset/delete_expected_source.py +15 -0
  131. pygeai/tests/snippets/evaluation/dataset/delete_filter_variable.py +15 -0
  132. pygeai/tests/snippets/evaluation/dataset/get_dataset.py +9 -0
  133. pygeai/tests/snippets/evaluation/dataset/get_dataset_row.py +10 -0
  134. pygeai/tests/snippets/evaluation/dataset/get_expected_source.py +15 -0
  135. pygeai/tests/snippets/evaluation/dataset/get_filter_variable.py +15 -0
  136. pygeai/tests/snippets/evaluation/dataset/list_dataset_rows.py +9 -0
  137. pygeai/tests/snippets/evaluation/dataset/list_datasets.py +6 -0
  138. pygeai/tests/snippets/evaluation/dataset/list_expected_sources.py +10 -0
  139. pygeai/tests/snippets/evaluation/dataset/list_filter_variables.py +10 -0
  140. pygeai/tests/snippets/evaluation/dataset/update_dataset.py +15 -0
  141. pygeai/tests/snippets/evaluation/dataset/update_dataset_row.py +20 -0
  142. pygeai/tests/snippets/evaluation/dataset/update_expected_source.py +18 -0
  143. pygeai/tests/snippets/evaluation/dataset/update_filter_variable.py +19 -0
  144. pygeai/tests/snippets/evaluation/dataset/upload_dataset_rows_file.py +10 -0
  145. pygeai/tests/snippets/evaluation/plan/__init__.py +0 -0
  146. pygeai/tests/snippets/evaluation/plan/add_plan_system_metric.py +13 -0
  147. pygeai/tests/snippets/evaluation/plan/complete_workflow_example.py +136 -0
  148. pygeai/tests/snippets/evaluation/plan/create_evaluation_plan.py +24 -0
  149. pygeai/tests/snippets/evaluation/plan/create_rag_evaluation_plan.py +22 -0
  150. pygeai/tests/snippets/evaluation/plan/delete_evaluation_plan.py +9 -0
  151. pygeai/tests/snippets/evaluation/plan/delete_plan_system_metric.py +13 -0
  152. pygeai/tests/snippets/evaluation/plan/execute_evaluation_plan.py +11 -0
  153. pygeai/tests/snippets/evaluation/plan/get_evaluation_plan.py +9 -0
  154. pygeai/tests/snippets/evaluation/plan/get_plan_system_metric.py +13 -0
  155. pygeai/tests/snippets/evaluation/plan/get_system_metric.py +9 -0
  156. pygeai/tests/snippets/evaluation/plan/list_evaluation_plans.py +7 -0
  157. pygeai/tests/snippets/evaluation/plan/list_plan_system_metrics.py +9 -0
  158. pygeai/tests/snippets/evaluation/plan/list_system_metrics.py +7 -0
  159. pygeai/tests/snippets/evaluation/plan/update_evaluation_plan.py +22 -0
  160. pygeai/tests/snippets/evaluation/plan/update_plan_system_metric.py +14 -0
  161. pygeai/tests/snippets/evaluation/result/__init__.py +0 -0
  162. pygeai/tests/snippets/evaluation/result/complete_workflow_example.py +150 -0
  163. pygeai/tests/snippets/evaluation/result/get_evaluation_result.py +26 -0
  164. pygeai/tests/snippets/evaluation/result/list_evaluation_results.py +17 -0
  165. pygeai/tests/snippets/migrate/__init__.py +45 -0
  166. pygeai/tests/snippets/migrate/agent_migration.py +110 -0
  167. pygeai/tests/snippets/migrate/assistant_migration.py +64 -0
  168. pygeai/tests/snippets/migrate/orchestrator_examples.py +179 -0
  169. pygeai/tests/snippets/migrate/process_migration.py +64 -0
  170. pygeai/tests/snippets/migrate/project_migration.py +42 -0
  171. pygeai/tests/snippets/migrate/tool_migration.py +64 -0
  172. pygeai/tests/snippets/organization/create_project.py +2 -2
  173. {pygeai-0.6.0b7.dist-info → pygeai-0.6.0b10.dist-info}/METADATA +1 -1
  174. {pygeai-0.6.0b7.dist-info → pygeai-0.6.0b10.dist-info}/RECORD +178 -96
  175. {pygeai-0.6.0b7.dist-info → pygeai-0.6.0b10.dist-info}/WHEEL +0 -0
  176. {pygeai-0.6.0b7.dist-info → pygeai-0.6.0b10.dist-info}/entry_points.txt +0 -0
  177. {pygeai-0.6.0b7.dist-info → pygeai-0.6.0b10.dist-info}/licenses/LICENSE +0 -0
  178. {pygeai-0.6.0b7.dist-info → pygeai-0.6.0b10.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,528 @@
1
+ Migration Guide
2
+ ===============
3
+
4
+ Overview
5
+ --------
6
+
7
+ The GEAI SDK provides powerful migration capabilities that allow you to clone and migrate projects and their resources between different GEAI instances or within the same instance. This feature is essential for:
8
+
9
+ - **Environment promotion**: Moving projects from development to staging to production
10
+ - **Backup and disaster recovery**: Creating copies of projects for safety
11
+ - **Multi-tenant deployments**: Replicating project setups across different organizations
12
+ - **Testing and experimentation**: Creating isolated copies for testing changes
13
+
14
+ The migration feature supports migrating the following resource types:
15
+
16
+ - **Agents**: AI agents with their configurations and prompts
17
+ - **Tools**: Custom tools and integrations
18
+ - **Agentic Processes**: Multi-step agentic workflows
19
+ - **Tasks**: Individual task definitions
20
+ - **Usage Limits**: Resource usage constraints and quotas
21
+ - **RAG Assistants**: Retrieval-Augmented Generation assistants
22
+ - **Files**: Project files and attachments
23
+
24
+ Key Features
25
+ ------------
26
+
27
+ **Selective Migration**
28
+ Migrate specific resources by ID or migrate all resources of a given type using the ``all`` keyword.
29
+
30
+ **Bulk Migration**
31
+ Use the ``--all`` flag to migrate every available resource type in a single command.
32
+
33
+ **Cross-Instance Migration**
34
+ Migrate projects between different GEAI instances with different API credentials.
35
+
36
+ **Same-Instance Cloning**
37
+ Clone projects within the same instance for testing or backup purposes.
38
+
39
+ **Automatic Resource Discovery**
40
+ When using ``all``, the migration tool automatically discovers and migrates all existing resources.
41
+
42
+ **Flexible Destination**
43
+ Migrate to a new project or to an existing project in the same or different instance.
44
+
45
+ Getting Started
46
+ ---------------
47
+
48
+ Prerequisites
49
+ ~~~~~~~~~~~~~
50
+
51
+ Before migrating, you need:
52
+
53
+ 1. **Source credentials**: API key and instance URL for the source project
54
+ 2. **Destination credentials**: API key and instance URL (can be the same as source)
55
+ 3. **Project identifiers**: Source project ID
56
+ 4. **Admin email**: Required when creating a new destination project
57
+
58
+ API Token Scopes
59
+ ~~~~~~~~~~~~~~~~~
60
+
61
+ Different migration operations require different API token scopes:
62
+
63
+ **Organization Scope Tokens**
64
+ Required for operations that create or manage projects and organization-level resources:
65
+
66
+ - **Project Creation**: Creating new projects requires organization scope API keys (``--from-org-key`` and ``--to-org-key``)
67
+ - **Usage Limit Migration**: Managing usage limits requires organization scope API keys
68
+
69
+ For more information, see the `Organization API Documentation <https://docs.globant.ai/en/wiki?22,Organization+API>`_ and `Usage Limits API Documentation <https://docs.globant.ai/en/wiki?802,Usage+Limits+API>`_.
70
+
71
+ **Project Scope Tokens**
72
+ Required for operations within a project:
73
+
74
+ - **Agent Migration**: Migrating agents within projects
75
+ - **Tool Migration**: Migrating tools within projects
76
+ - **Agentic Process Migration**: Migrating agentic processes
77
+ - **Task Migration**: Migrating tasks
78
+ - **RAG Assistant Migration**: Migrating RAG assistants
79
+ - **File Migration**: Migrating files within projects
80
+
81
+ Migration Scenarios and Required Keys
82
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83
+
84
+ The required API keys depend on whether you're creating a new project or migrating to an existing one:
85
+
86
+ **Scenario 1: Creating a New Project**
87
+ When using ``--to-project-name`` and ``--admin-email``:
88
+
89
+ - ``--from-api-key``: **Project scope** token for reading source resources
90
+ - ``--from-org-key``: **Organization scope** token (REQUIRED for project creation)
91
+ - ``--to-org-key``: **Organization scope** token for destination instance (REQUIRED, or use ``--from-org-key`` for same instance)
92
+ - ``--to-api-key``: OPTIONAL - If not provided, a project scope API key will be automatically created for the new project
93
+
94
+ The migration tool will:
95
+
96
+ 1. Create the new project using organization scope keys
97
+ 2. Automatically generate a project scope API key for the new project
98
+ 3. Use the generated key to migrate all resources
99
+
100
+ **Scenario 2: Migrating to an Existing Project**
101
+ When using ``--to-project-id``:
102
+
103
+ - ``--from-api-key``: **Project scope** token for reading source resources (REQUIRED)
104
+ - ``--to-api-key``: **Project scope** token for writing to destination project (REQUIRED)
105
+ - Organization scope keys are NOT needed for resource migration
106
+
107
+ .. warning::
108
+ When migrating to an existing project (using ``--to-project-id``), you MUST provide ``--to-api-key``. This is a project scope token that has write access to the destination project.
109
+
110
+ Basic Usage
111
+ -----------
112
+
113
+ Migrate Everything
114
+ ~~~~~~~~~~~~~~~~~~
115
+
116
+ The simplest and most common use case is to migrate an entire project with all its resources:
117
+
118
+ .. code-block:: shell
119
+
120
+ geai migrate clone-project \\
121
+ --from-api-key "source_api_key_123" \\
122
+ --from-project-id "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p" \\
123
+ --from-instance "https://api.source.example.ai" \\
124
+ --to-project-name "Cloned Project" \\
125
+ --admin-email "admin@example.com" \\
126
+ --all
127
+
128
+ This command will:
129
+
130
+ 1. Create a new project named "Cloned Project"
131
+ 2. Discover all resources in the source project
132
+ 3. Migrate all agents, tools, processes, tasks, usage limits, RAG assistants, and files
133
+ 4. Display progress and results
134
+
135
+ Migrate to Different Instance
136
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137
+
138
+ To migrate between different GEAI instances, provide the destination instance details:
139
+
140
+ .. code-block:: shell
141
+
142
+ geai migrate clone-project \\
143
+ --from-api-key "source_api_key_123" \\
144
+ --from-project-id "source-project-id" \\
145
+ --from-instance "https://api.dev.example.ai" \\
146
+ --to-api-key "destination_api_key_456" \\
147
+ --to-project-name "Production Project" \\
148
+ --to-instance "https://api.prod.example.ai" \\
149
+ --to-organization-id "prod-org-id" \\
150
+ --admin-email "prod-admin@example.com" \\
151
+ --all
152
+
153
+ Selective Migration
154
+ -------------------
155
+
156
+ Migrate Specific Resource Types
157
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158
+
159
+ Instead of migrating everything, you can selectively migrate specific resource types:
160
+
161
+ **Migrate all agents only:**
162
+
163
+ .. code-block:: shell
164
+
165
+ geai migrate clone-project \\
166
+ --from-api-key "source_api_key_123" \\
167
+ --from-project-id "source-project-id" \\
168
+ --from-instance "https://api.example.ai" \\
169
+ --to-project-name "Agents Only" \\
170
+ --admin-email "admin@example.com" \\
171
+ --agents all
172
+
173
+ **Migrate all tools only:**
174
+
175
+ .. code-block:: shell
176
+
177
+ geai migrate clone-project \\
178
+ --from-api-key "source_api_key_123" \\
179
+ --from-project-id "source-project-id" \\
180
+ --from-instance "https://api.example.ai" \\
181
+ --to-project-name "Tools Only" \\
182
+ --admin-email "admin@example.com" \\
183
+ --tools all
184
+
185
+ **Migrate all RAG assistants only:**
186
+
187
+ .. code-block:: shell
188
+
189
+ geai migrate clone-project \\
190
+ --from-api-key "source_api_key_123" \\
191
+ --from-project-id "source-project-id" \\
192
+ --from-instance "https://api.example.ai" \\
193
+ --to-project-name "RAG Assistants Only" \\
194
+ --admin-email "admin@example.com" \\
195
+ --rag-assistants all
196
+
197
+ Migrate Specific Resources by ID
198
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199
+
200
+ For fine-grained control, specify comma-separated resource IDs:
201
+
202
+ **Migrate specific agents:**
203
+
204
+ .. code-block:: shell
205
+
206
+ geai migrate clone-project \\
207
+ --from-api-key "source_api_key_123" \\
208
+ --from-project-id "source-project-id" \\
209
+ --from-instance "https://api.example.ai" \\
210
+ --to-project-name "Selected Agents" \\
211
+ --admin-email "admin@example.com" \\
212
+ --agents "agent-id-1,agent-id-2,agent-id-3"
213
+
214
+ **Migrate specific tools:**
215
+
216
+ .. code-block:: shell
217
+
218
+ geai migrate clone-project \\
219
+ --from-api-key "source_api_key_123" \\
220
+ --from-project-id "source-project-id" \\
221
+ --from-instance "https://api.example.ai" \\
222
+ --to-project-name "Selected Tools" \\
223
+ --admin-email "admin@example.com" \\
224
+ --tools "tool-id-1,tool-id-2"
225
+
226
+ Mixed Migration Strategies
227
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
228
+
229
+ Combine different migration strategies for maximum flexibility:
230
+
231
+ .. code-block:: shell
232
+
233
+ geai migrate clone-project \\
234
+ --from-api-key "source_api_key_123" \\
235
+ --from-project-id "source-project-id" \\
236
+ --from-instance "https://api.example.ai" \\
237
+ --to-project-name "Mixed Migration" \\
238
+ --admin-email "admin@example.com" \\
239
+ --agents all \\
240
+ --tools "tool-id-1,tool-id-2" \\
241
+ --rag-assistants all \\
242
+ --files all
243
+
244
+ This command migrates:
245
+
246
+ - **ALL** agents (auto-discovered)
247
+ - **SPECIFIC** tools (by ID)
248
+ - **ALL** RAG assistants (auto-discovered)
249
+ - **ALL** files (auto-discovered)
250
+
251
+ Advanced Usage
252
+ --------------
253
+
254
+ Migrate with Organization Context
255
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
256
+
257
+ When migrating between organizations, specify organization IDs:
258
+
259
+ .. code-block:: shell
260
+
261
+ geai migrate clone-project \\
262
+ --from-api-key "source_api_key_123" \\
263
+ --from-project-id "source-project-id" \\
264
+ --from-organization-id "source-org-id" \\
265
+ --from-instance "https://api.example.ai" \\
266
+ --to-api-key "destination_api_key_456" \\
267
+ --to-project-name "Cross-Org Project" \\
268
+ --to-organization-id "destination-org-id" \\
269
+ --to-instance "https://api.example.ai" \\
270
+ --admin-email "admin@example.com" \\
271
+ --all
272
+
273
+ Migrate All AI Lab Resources
274
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
275
+
276
+ To migrate all AI Lab-related resources (agents, tools, processes, tasks):
277
+
278
+ .. code-block:: shell
279
+
280
+ geai migrate clone-project \\
281
+ --from-api-key "source_api_key_123" \\
282
+ --from-project-id "source-project-id" \\
283
+ --from-instance "https://api.example.ai" \\
284
+ --to-project-name "AI Lab Resources" \\
285
+ --admin-email "admin@example.com" \\
286
+ --agents all \\
287
+ --tools all \\
288
+ --agentic-processes all \\
289
+ --tasks all
290
+
291
+ CLI Reference
292
+ -------------
293
+
294
+ Command: ``geai migrate clone-project``
295
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
296
+
297
+ **Description:** Clone a project with selective or complete resource migration.
298
+
299
+ **Required Arguments:**
300
+
301
+ ``--from-api-key <key>``
302
+ Project scope API key for the source GEAI instance (for migrating resources)
303
+
304
+ ``--from-project-id <id>``
305
+ ID of the source project to migrate from
306
+
307
+ ``--from-instance <url>``
308
+ URL of the source GEAI instance
309
+
310
+ **Optional Arguments:**
311
+
312
+ ``--from-org-key <key>``
313
+ Organization scope API key for the source instance (REQUIRED when creating projects or migrating usage limits)
314
+
315
+ ``--to-api-key <key>``
316
+ Project scope API key for the destination instance. **REQUIRED** when using ``--to-project-id`` (existing project). OPTIONAL when creating a new project (auto-generated if not provided)
317
+
318
+ ``--to-org-key <key>``
319
+ Organization scope API key for the destination instance (REQUIRED when creating projects or migrating usage limits)
320
+
321
+ ``--to-project-id <id>``
322
+ Destination project ID (use this to migrate to an existing project). **REQUIRED**: ``--to-api-key`` must also be provided. **MUTUALLY EXCLUSIVE** with ``--to-project-name`` and ``--admin-email``
323
+
324
+ ``--to-project-name <name>``
325
+ Name for the new destination project (when specified with --admin-email, creates a new project). **MUTUALLY EXCLUSIVE** with ``--to-project-id``
326
+
327
+ ``--admin-email <email>``
328
+ Admin email for the new project (required when creating a new project with --to-project-name)
329
+
330
+ ``--to-instance <url>``
331
+ URL of the destination instance (defaults to source instance if omitted)
332
+
333
+ ``--from-organization-id <id>``
334
+ Organization ID in the source instance (required for usage limits and file migration)
335
+
336
+ ``--to-organization-id <id>``
337
+ Organization ID in the destination instance (required for usage limits and file migration)
338
+
339
+ **Migration Flags:**
340
+
341
+ ``--all``
342
+ Migrate all available resource types (agents, tools, processes, tasks, usage limits, RAG assistants, files)
343
+
344
+ ``--agents <all|id1,id2,...>``
345
+ Migrate all agents or specific agents by ID (comma-separated)
346
+
347
+ ``--tools <all|id1,id2,...>``
348
+ Migrate all tools or specific tools by ID (comma-separated)
349
+
350
+ ``--agentic-processes <all|id1,id2,...>``
351
+ Migrate all agentic processes or specific processes by ID (comma-separated)
352
+
353
+ ``--tasks <all|id1,id2,...>``
354
+ Migrate all tasks or specific tasks by ID (comma-separated)
355
+
356
+ ``--usage-limits <all|id1,id2,...>``
357
+ Migrate all usage limits or specific usage limits by ID (comma-separated)
358
+
359
+ ``--rag-assistants <all|id1,id2,...>``
360
+ Migrate all RAG assistants or specific assistants by ID (comma-separated)
361
+
362
+ ``--files <all|id1,id2,...>``
363
+ Migrate all files or specific files by ID (comma-separated)
364
+
365
+ ``--stop-on-error <0|1>`` or ``--soe <0|1>``
366
+ Control migration behavior on errors. Set to ``1`` (default) to stop migration on first error, or ``0`` to continue migrating remaining resources even if some fail
367
+
368
+ Migration Behavior
369
+ ------------------
370
+
371
+ Resource Discovery
372
+ ~~~~~~~~~~~~~~~~~~
373
+
374
+ When you use ``all`` for any resource type, the migration tool:
375
+
376
+ 1. Connects to the source instance
377
+ 2. Lists all available resources of that type
378
+ 3. Filters resources with valid IDs/names
379
+ 4. Creates migration strategies for each discovered resource
380
+ 5. Displays the count of discovered resources
381
+
382
+ For example:
383
+
384
+ .. code-block:: shell
385
+
386
+ geai migrate clone-project ... --agents all
387
+
388
+ Will output something like:
389
+
390
+ .. code-block:: text
391
+
392
+ Discovered 15 agents
393
+ Migrating agents...
394
+ [Progress indicators]
395
+
396
+ Error Handling
397
+ ~~~~~~~~~~~~~~
398
+
399
+ The migration process includes robust error handling:
400
+
401
+ - Invalid API keys or instances result in clear error messages
402
+ - Missing required parameters are detected before migration starts
403
+ - Individual resource migration failures are logged but don't stop the entire process by default (unless ``--stop-on-error 1`` is set)
404
+ - Final migration result includes success/failure status for each resource
405
+ - Use ``--stop-on-error 0`` to continue migrating all resources even if some fail, or ``--stop-on-error 1`` (default) to halt on first error
406
+
407
+ Best Practices
408
+ --------------
409
+
410
+ 1. **Test First**: Always test migrations in a development environment before production
411
+ 2. **Use --all for Complete Clones**: When creating backups or full clones, use ``--all``
412
+ 3. **Verify Credentials**: Double-check API keys and instance URLs before running migrations
413
+ 4. **Monitor Progress**: Watch the console output for discovery counts and migration status
414
+ 5. **Check Results**: Review the migration result summary after completion
415
+ 6. **Incremental Migration**: For large projects, consider migrating resource types incrementally
416
+ 7. **Document Migrations**: Keep track of what was migrated and when
417
+
418
+ Common Use Cases
419
+ ----------------
420
+
421
+ Development to Production Promotion (with new project creation)
422
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
423
+
424
+ .. code-block:: shell
425
+
426
+ geai migrate clone-project \\
427
+ --from-api-key "dev_project_api_key" \\
428
+ --from-org-key "dev_org_api_key" \\
429
+ --from-project-id "dev-project-id" \\
430
+ --from-instance "https://api.dev.example.ai" \\
431
+ --to-api-key "prod_project_api_key" \\
432
+ --to-org-key "prod_org_api_key" \\
433
+ --to-project-name "Production Release v1.0" \\
434
+ --to-instance "https://api.prod.example.ai" \\
435
+ --admin-email "prod-admin@example.com" \\
436
+ --all
437
+
438
+ Project Backup (with new project creation)
439
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
440
+
441
+ .. code-block:: shell
442
+
443
+ geai migrate clone-project \\
444
+ --from-api-key "project_api_key" \\
445
+ --from-org-key "org_api_key" \\
446
+ --from-project-id "main-project-id" \\
447
+ --from-instance "https://api.example.ai" \\
448
+ --to-org-key "org_api_key" \\
449
+ --to-project-name "Main Project Backup $(date +%Y-%m-%d)" \\
450
+ --admin-email "admin@example.com" \\
451
+ --all
452
+
453
+ Migrate Resources to Existing Project (no org keys needed)
454
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
455
+
456
+ When migrating to an existing project, you must provide both ``--to-project-id`` and ``--to-api-key``:
457
+
458
+ .. code-block:: shell
459
+
460
+ geai migrate clone-project \\
461
+ --from-api-key "source_project_api_key" \\
462
+ --from-project-id "source-project-id" \\
463
+ --from-instance "https://api.example.ai" \\
464
+ --to-project-id "existing-project-id" \\
465
+ --to-api-key "target_project_api_key" \\
466
+ --agents all \\
467
+ --tools all
468
+
469
+ This example migrates all agents and tools to an existing project without requiring organization scope API keys.
470
+
471
+ Troubleshooting
472
+ ---------------
473
+
474
+ Migration Fails with Authentication Error
475
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
476
+
477
+ **Problem**: ``Error retrieving project_id from GEAI: Authentication failed``
478
+
479
+ **Solution**: Verify your API keys are correct and have necessary permissions:
480
+
481
+ - When creating a new project (``--to-project-name`` + ``--admin-email``): You MUST provide **organization scope** API keys via ``--from-org-key`` and ``--to-org-key``
482
+ - When migrating usage limits (``--usage-limits``): You MUST provide **organization scope** API keys via ``--from-org-key`` and ``--to-org-key``
483
+ - For other resource migrations: Use **project scope** API keys via ``--from-api-key`` and ``--to-api-key``
484
+
485
+ Missing Organization Scope API Keys
486
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
487
+
488
+ **Problem**: ``Source organization scope API key (--from-org-key) is required for project creation``
489
+
490
+ **Solution**: When creating a new project or migrating usage limits, you must explicitly provide organization scope API keys using ``--from-org-key`` and ``--to-org-key`` parameters. Project scope API keys cannot be used for these operations
491
+
492
+ Missing Destination Project API Key
493
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
494
+
495
+ **Problem**: ``Destination project API key (--to-api-key) is required when migrating to an existing project (--to-project-id)``
496
+
497
+ **Solution**: When migrating to an existing project using ``--to-project-id``, you MUST provide ``--to-api-key`` with a project scope API key that has write access to the destination project. This is required because the migration tool needs to create resources in the existing project.
498
+
499
+ **Note**: When creating a NEW project (using ``--to-project-name`` and ``--admin-email``), ``--to-api-key`` is optional and will be automatically generated if not provided.
500
+
501
+ Migration Discovers No Resources
502
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
503
+
504
+ **Problem**: ``Discovered 0 agents`` when you know resources exist
505
+
506
+ **Solution**: Check that the ``--from-project-id`` is correct and the API key has read access
507
+
508
+ Partial Migration Success
509
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
510
+
511
+ **Problem**: Some resources migrate successfully, others fail
512
+
513
+ **Solution**: Check the error log for specific resource failures and retry individual resources if needed
514
+
515
+ Limitations
516
+ -----------
517
+
518
+ - API rate limits may affect large migrations
519
+ - Some resource dependencies may require specific migration order
520
+ - Cross-instance migrations require network connectivity between instances
521
+ - Certain resource types may have instance-specific configurations
522
+
523
+ See Also
524
+ --------
525
+
526
+ - :doc:`cli` - General CLI usage
527
+ - :doc:`ai_lab` - AI Lab concepts and resources
528
+ - :doc:`quickstart` - Getting started with GEAI SDK
@@ -4,4 +4,4 @@ PyGEAI - Modules
4
4
  .. toctree::
5
5
  :maxdepth: 4
6
6
 
7
- content/pygeai
7
+ ../pygeai
@@ -13,6 +13,14 @@ Subpackages
13
13
  Submodules
14
14
  ----------
15
15
 
16
+ pygeai.cli.error\_handler module
17
+ --------------------------------
18
+
19
+ .. automodule:: pygeai.cli.error_handler
20
+ :members:
21
+ :show-inheritance:
22
+ :undoc-members:
23
+
16
24
  pygeai.cli.geai module
17
25
  ----------------------
18
26
 
@@ -13,6 +13,22 @@ Subpackages
13
13
  Submodules
14
14
  ----------
15
15
 
16
+ pygeai.tests.cli.test\_error\_handler module
17
+ --------------------------------------------
18
+
19
+ .. automodule:: pygeai.tests.cli.test_error_handler
20
+ :members:
21
+ :show-inheritance:
22
+ :undoc-members:
23
+
24
+ pygeai.tests.cli.test\_geai\_driver module
25
+ ------------------------------------------
26
+
27
+ .. automodule:: pygeai.tests.cli.test_geai_driver
28
+ :members:
29
+ :show-inheritance:
30
+ :undoc-members:
31
+
16
32
  pygeai.tests.cli.test\_parsers module
17
33
  -------------------------------------
18
34
 
@@ -12,6 +12,22 @@ pygeai.tests.core.embeddings.test\_clients module
12
12
  :show-inheritance:
13
13
  :undoc-members:
14
14
 
15
+ pygeai.tests.core.embeddings.test\_managers module
16
+ --------------------------------------------------
17
+
18
+ .. automodule:: pygeai.tests.core.embeddings.test_managers
19
+ :members:
20
+ :show-inheritance:
21
+ :undoc-members:
22
+
23
+ pygeai.tests.core.embeddings.test\_mappers module
24
+ -------------------------------------------------
25
+
26
+ .. automodule:: pygeai.tests.core.embeddings.test_mappers
27
+ :members:
28
+ :show-inheritance:
29
+ :undoc-members:
30
+
15
31
  Module contents
16
32
  ---------------
17
33
 
@@ -60,6 +60,14 @@ pygeai.tests.snippets.chat.chat\_completion\_streaming module
60
60
  :show-inheritance:
61
61
  :undoc-members:
62
62
 
63
+ pygeai.tests.snippets.chat.chat\_completion\_with\_reasoning\_effort module
64
+ ---------------------------------------------------------------------------
65
+
66
+ .. automodule:: pygeai.tests.snippets.chat.chat_completion_with_reasoning_effort
67
+ :members:
68
+ :show-inheritance:
69
+ :undoc-members:
70
+
63
71
  pygeai.tests.snippets.chat.get\_request\_status module
64
72
  ------------------------------------------------------
65
73
 
@@ -68,6 +76,38 @@ pygeai.tests.snippets.chat.get\_request\_status module
68
76
  :show-inheritance:
69
77
  :undoc-members:
70
78
 
79
+ pygeai.tests.snippets.chat.get\_response module
80
+ -----------------------------------------------
81
+
82
+ .. automodule:: pygeai.tests.snippets.chat.get_response
83
+ :members:
84
+ :show-inheritance:
85
+ :undoc-members:
86
+
87
+ pygeai.tests.snippets.chat.get\_response\_streaming module
88
+ ----------------------------------------------------------
89
+
90
+ .. automodule:: pygeai.tests.snippets.chat.get_response_streaming
91
+ :members:
92
+ :show-inheritance:
93
+ :undoc-members:
94
+
95
+ pygeai.tests.snippets.chat.get\_response\_with\_files module
96
+ ------------------------------------------------------------
97
+
98
+ .. automodule:: pygeai.tests.snippets.chat.get_response_with_files
99
+ :members:
100
+ :show-inheritance:
101
+ :undoc-members:
102
+
103
+ pygeai.tests.snippets.chat.get\_response\_with\_tools module
104
+ ------------------------------------------------------------
105
+
106
+ .. automodule:: pygeai.tests.snippets.chat.get_response_with_tools
107
+ :members:
108
+ :show-inheritance:
109
+ :undoc-members:
110
+
71
111
  pygeai.tests.snippets.chat.send\_chat\_request module
72
112
  -----------------------------------------------------
73
113
 
@@ -0,0 +1,45 @@
1
+ pygeai.tests.snippets.dbg package
2
+ =================================
3
+
4
+ Submodules
5
+ ----------
6
+
7
+ pygeai.tests.snippets.dbg.basic\_debugging module
8
+ -------------------------------------------------
9
+
10
+ .. automodule:: pygeai.tests.snippets.dbg.basic_debugging
11
+ :members:
12
+ :show-inheritance:
13
+ :undoc-members:
14
+
15
+ pygeai.tests.snippets.dbg.breakpoint\_management module
16
+ -------------------------------------------------------
17
+
18
+ .. automodule:: pygeai.tests.snippets.dbg.breakpoint_management
19
+ :members:
20
+ :show-inheritance:
21
+ :undoc-members:
22
+
23
+ pygeai.tests.snippets.dbg.stack\_navigation module
24
+ --------------------------------------------------
25
+
26
+ .. automodule:: pygeai.tests.snippets.dbg.stack_navigation
27
+ :members:
28
+ :show-inheritance:
29
+ :undoc-members:
30
+
31
+ pygeai.tests.snippets.dbg.stepping\_example module
32
+ --------------------------------------------------
33
+
34
+ .. automodule:: pygeai.tests.snippets.dbg.stepping_example
35
+ :members:
36
+ :show-inheritance:
37
+ :undoc-members:
38
+
39
+ Module contents
40
+ ---------------
41
+
42
+ .. automodule:: pygeai.tests.snippets.dbg
43
+ :members:
44
+ :show-inheritance:
45
+ :undoc-members: