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.
- pygeai/__init__.py +1 -2
- pygeai/_docs/source/content/api_reference/project.rst +392 -0
- pygeai/_docs/source/content/authentication.rst +130 -1
- pygeai/_docs/source/content/debugger.rst +327 -157
- pygeai/_docs/source/content/migration.rst +391 -7
- pygeai/_docs/source/pygeai.core.common.rst +8 -0
- pygeai/_docs/source/pygeai.tests.auth.rst +56 -0
- pygeai/_docs/source/pygeai.tests.cli.rst +8 -0
- pygeai/admin/clients.py +1 -3
- pygeai/analytics/clients.py +1 -1
- pygeai/assistant/clients.py +2 -7
- pygeai/assistant/data/clients.py +0 -8
- pygeai/assistant/data_analyst/clients.py +0 -2
- pygeai/assistant/managers.py +1 -1
- pygeai/assistant/rag/clients.py +0 -2
- pygeai/assistant/rag/mappers.py +9 -11
- pygeai/auth/clients.py +26 -7
- pygeai/auth/endpoints.py +2 -1
- pygeai/chat/clients.py +2 -2
- pygeai/chat/managers.py +1 -1
- pygeai/cli/commands/admin.py +13 -25
- pygeai/cli/commands/analytics.py +56 -88
- pygeai/cli/commands/assistant.py +84 -138
- pygeai/cli/commands/auth.py +23 -46
- pygeai/cli/commands/base.py +0 -1
- pygeai/cli/commands/chat.py +218 -209
- pygeai/cli/commands/common.py +5 -5
- pygeai/cli/commands/configuration.py +79 -29
- pygeai/cli/commands/docs.py +3 -4
- pygeai/cli/commands/embeddings.py +13 -19
- pygeai/cli/commands/evaluation.py +133 -344
- pygeai/cli/commands/feedback.py +7 -15
- pygeai/cli/commands/files.py +26 -53
- pygeai/cli/commands/gam.py +28 -69
- pygeai/cli/commands/lab/ai_lab.py +96 -142
- pygeai/cli/commands/lab/common.py +1 -1
- pygeai/cli/commands/lab/spec.py +12 -32
- pygeai/cli/commands/llm.py +9 -18
- pygeai/cli/commands/migrate.py +43 -99
- pygeai/cli/commands/organization.py +223 -196
- pygeai/cli/commands/rag.py +35 -58
- pygeai/cli/commands/rerank.py +21 -25
- pygeai/cli/commands/secrets.py +39 -67
- pygeai/cli/commands/usage_limits.py +50 -136
- pygeai/cli/commands/validators.py +1 -1
- pygeai/cli/geai.py +32 -3
- pygeai/cli/geai_proxy.py +6 -2
- pygeai/cli/install_man.py +1 -1
- pygeai/cli/parsers.py +1 -1
- pygeai/core/base/clients.py +90 -21
- pygeai/core/base/mappers.py +39 -55
- pygeai/core/base/session.py +134 -22
- pygeai/core/common/config.py +50 -13
- pygeai/core/common/constants.py +8 -0
- pygeai/core/common/exceptions.py +6 -0
- pygeai/core/embeddings/clients.py +0 -1
- pygeai/core/embeddings/managers.py +0 -1
- pygeai/core/feedback/clients.py +0 -2
- pygeai/core/feedback/models.py +1 -1
- pygeai/core/files/clients.py +0 -3
- pygeai/core/files/managers.py +1 -1
- pygeai/core/files/mappers.py +4 -5
- pygeai/core/llm/clients.py +0 -1
- pygeai/core/models.py +4 -4
- pygeai/core/plugins/clients.py +0 -3
- pygeai/core/plugins/models.py +2 -2
- pygeai/core/rerank/clients.py +0 -2
- pygeai/core/secrets/clients.py +0 -2
- pygeai/core/services/rest.py +80 -14
- pygeai/core/singleton.py +24 -0
- pygeai/dbg/__init__.py +2 -2
- pygeai/dbg/debugger.py +276 -38
- pygeai/evaluation/clients.py +2 -4
- pygeai/evaluation/dataset/clients.py +0 -1
- pygeai/evaluation/plan/clients.py +0 -2
- pygeai/evaluation/result/clients.py +0 -2
- pygeai/gam/clients.py +1 -3
- pygeai/health/clients.py +1 -3
- pygeai/lab/clients.py +0 -1
- pygeai/lab/managers.py +0 -1
- pygeai/lab/models.py +0 -1
- pygeai/lab/strategies/clients.py +1 -2
- pygeai/lab/tools/clients.py +2 -2
- pygeai/lab/tools/mappers.py +1 -1
- pygeai/migration/strategies.py +5 -6
- pygeai/migration/tools.py +1 -1
- pygeai/organization/clients.py +118 -12
- pygeai/organization/endpoints.py +1 -0
- pygeai/organization/limits/clients.py +4 -6
- pygeai/organization/limits/managers.py +1 -4
- pygeai/organization/managers.py +2 -2
- pygeai/proxy/config.py +1 -0
- pygeai/proxy/managers.py +6 -5
- pygeai/tests/admin/test_clients.py +11 -11
- pygeai/tests/assistants/rag/test_clients.py +1 -1
- pygeai/tests/assistants/rag/test_models.py +1 -2
- pygeai/tests/assistants/test_clients.py +1 -1
- pygeai/tests/assistants/test_managers.py +1 -3
- pygeai/tests/auth/test_cli_configuration.py +252 -0
- pygeai/tests/auth/test_client_initialization.py +411 -0
- pygeai/tests/auth/test_clients.py +29 -27
- pygeai/tests/auth/test_config_manager.py +305 -0
- pygeai/tests/auth/test_header_injection.py +294 -0
- pygeai/tests/auth/test_oauth.py +3 -1
- pygeai/tests/auth/test_session_logging.py +119 -0
- pygeai/tests/auth/test_session_validation.py +408 -0
- pygeai/tests/auth/test_singleton_reset.py +201 -0
- pygeai/tests/chat/test_clients.py +1 -1
- pygeai/tests/chat/test_iris.py +1 -1
- pygeai/tests/chat/test_ui.py +0 -2
- pygeai/tests/cli/commands/lab/test_ai_lab.py +1 -3
- pygeai/tests/cli/commands/lab/test_common.py +0 -1
- pygeai/tests/cli/commands/test_chat.py +1 -1
- pygeai/tests/cli/commands/test_common.py +0 -1
- pygeai/tests/cli/commands/test_embeddings.py +2 -2
- pygeai/tests/cli/commands/test_evaluation.py +1 -9
- pygeai/tests/cli/commands/test_llm.py +1 -1
- pygeai/tests/cli/commands/test_migrate.py +1 -1
- pygeai/tests/cli/commands/test_rerank.py +0 -1
- pygeai/tests/cli/commands/test_secrets.py +1 -1
- pygeai/tests/cli/commands/test_show_help.py +0 -1
- pygeai/tests/cli/commands/test_validators.py +0 -1
- pygeai/tests/cli/test_credentials_flag.py +312 -0
- pygeai/tests/cli/test_error_handler.py +0 -1
- pygeai/tests/core/base/test_mappers.py +2 -2
- pygeai/tests/core/base/test_models.py +4 -4
- pygeai/tests/core/common/test_config.py +2 -7
- pygeai/tests/core/common/test_decorators.py +0 -1
- pygeai/tests/core/embeddings/test_managers.py +1 -1
- pygeai/tests/core/feedback/test_clients.py +2 -2
- pygeai/tests/core/files/test_clients.py +6 -6
- pygeai/tests/core/files/test_models.py +0 -1
- pygeai/tests/core/files/test_responses.py +0 -1
- pygeai/tests/core/llm/test_clients.py +1 -1
- pygeai/tests/core/plugins/test_clients.py +4 -4
- pygeai/tests/core/rerank/test_mappers.py +1 -3
- pygeai/tests/core/secrets/test_clients.py +2 -3
- pygeai/tests/core/services/test_rest.py +10 -10
- pygeai/tests/core/utils/test_console.py +0 -1
- pygeai/tests/dbg/test_debugger.py +95 -8
- pygeai/tests/evaluation/dataset/test_clients.py +24 -27
- pygeai/tests/evaluation/plan/test_clients.py +16 -18
- pygeai/tests/evaluation/result/test_clients.py +4 -5
- pygeai/tests/health/test_clients.py +2 -2
- pygeai/tests/integration/lab/agents/test_create_agent.py +1 -3
- pygeai/tests/integration/lab/agents/test_get_agent.py +1 -1
- pygeai/tests/integration/lab/processes/test_create_process.py +2 -2
- pygeai/tests/integration/lab/processes/test_create_task.py +2 -3
- pygeai/tests/integration/lab/processes/test_delete_process.py +0 -1
- pygeai/tests/integration/lab/processes/test_get_process.py +2 -4
- pygeai/tests/integration/lab/processes/test_list_process_instances.py +1 -3
- pygeai/tests/integration/lab/processes/test_update_process.py +3 -9
- pygeai/tests/integration/lab/reasoning_strategies/test_update_reasoning_strategy.py +1 -2
- pygeai/tests/integration/lab/tools/test_delete_tool.py +1 -1
- pygeai/tests/integration/lab/tools/test_list_tools.py +1 -1
- pygeai/tests/integration/lab/tools/test_update_tool.py +1 -1
- pygeai/tests/lab/agents/test_clients.py +17 -17
- pygeai/tests/lab/processes/test_clients.py +67 -67
- pygeai/tests/lab/processes/test_mappers.py +23 -23
- pygeai/tests/lab/spec/test_loader.py +0 -2
- pygeai/tests/lab/spec/test_parsers.py +1 -2
- pygeai/tests/lab/strategies/test_clients.py +10 -10
- pygeai/tests/lab/test_managers.py +3 -5
- pygeai/tests/lab/test_mappers.py +1 -4
- pygeai/tests/lab/tools/test_clients.py +21 -21
- pygeai/tests/lab/tools/test_mappers.py +0 -1
- pygeai/tests/organization/limits/test_clients.py +33 -33
- pygeai/tests/organization/limits/test_managers.py +7 -7
- pygeai/tests/organization/test_clients.py +78 -60
- pygeai/tests/proxy/test_clients.py +1 -1
- pygeai/tests/proxy/test_integration.py +1 -4
- pygeai/tests/proxy/test_managers.py +1 -2
- pygeai/tests/proxy/test_servers.py +1 -2
- pygeai/tests/snippets/assistants/rag/delete_rag_assistant.py +0 -1
- pygeai/tests/snippets/assistants/rag/get_documents.py +0 -1
- pygeai/tests/snippets/assistants/rag/get_rag_assistant_data.py +0 -1
- pygeai/tests/snippets/chat/get_request_status.py +0 -1
- pygeai/tests/snippets/dbg/file_debugging.py +72 -0
- pygeai/tests/snippets/dbg/module_debugging.py +60 -0
- pygeai/tests/snippets/embeddings/cohere_example.py +2 -2
- pygeai/tests/snippets/embeddings/openai_base64_example.py +1 -1
- pygeai/tests/snippets/evaluation/dataset/complete_workflow_example.py +8 -8
- pygeai/tests/snippets/evaluation/plan/complete_workflow_example.py +5 -5
- pygeai/tests/snippets/evaluation/result/complete_workflow_example.py +3 -3
- pygeai/tests/snippets/lab/agentic_flow_example_1.py +1 -1
- pygeai/tests/snippets/lab/agentic_flow_example_2.py +3 -4
- pygeai/tests/snippets/lab/agents/create_agent_with_permissions.py +2 -2
- pygeai/tests/snippets/lab/agents/delete_agent.py +1 -2
- pygeai/tests/snippets/lab/agents/get_agent.py +1 -1
- pygeai/tests/snippets/lab/agents/get_agent_with_new_fields.py +10 -10
- pygeai/tests/snippets/lab/agents/get_sharing_link.py +0 -1
- pygeai/tests/snippets/lab/agents/list_agents.py +1 -1
- pygeai/tests/snippets/lab/agents/publish_agent_revision.py +0 -1
- pygeai/tests/snippets/lab/agents/update_agent_properties.py +1 -1
- pygeai/tests/snippets/lab/crud_ui.py +3 -5
- pygeai/tests/snippets/lab/processes/kbs/get_kb.py +0 -1
- pygeai/tests/snippets/lab/processes/kbs/list_kbs.py +0 -1
- pygeai/tests/snippets/lab/processes/list_processes.py +1 -1
- pygeai/tests/snippets/lab/samples/summarize_files.py +0 -3
- pygeai/tests/snippets/lab/strategies/get_reasoning_strategy.py +0 -1
- pygeai/tests/snippets/lab/strategies/list_reasoning_strategies.py +1 -1
- pygeai/tests/snippets/lab/tools/get_tool.py +1 -1
- pygeai/tests/snippets/lab/tools/publish_tool_revision.py +0 -1
- pygeai/tests/snippets/lab/tools/set_parameters.py +1 -2
- pygeai/tests/snippets/lab/use_cases/c_code_fixer_agent_flow.py +2 -3
- pygeai/tests/snippets/lab/use_cases/file_summarizer_example_2.py +1 -1
- pygeai/tests/snippets/lab/use_cases/update_cli_expert.py +0 -1
- pygeai/tests/snippets/lab/use_cases/update_lab_expert.py +0 -1
- pygeai/tests/snippets/lab/use_cases/update_web_designer.py +0 -1
- pygeai/tests/snippets/lab/use_cases/update_web_reader.py +0 -1
- pygeai/tests/snippets/migrate/orchestrator_examples.py +1 -1
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/METADATA +32 -7
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/RECORD +217 -206
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/WHEEL +0 -0
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/entry_points.txt +0 -0
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/licenses/LICENSE +0 -0
- {pygeai-0.6.0b13.dist-info → pygeai-0.6.1.dist-info}/top_level.txt +0 -0
pygeai/cli/commands/llm.py
CHANGED
|
@@ -21,10 +21,8 @@ def get_provider_list():
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
def get_provider_data(option_list: list):
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if option_flag.name == "provider_name":
|
|
27
|
-
provider_name = option_arg
|
|
24
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
25
|
+
provider_name = opts.get('provider_name')
|
|
28
26
|
|
|
29
27
|
if not provider_name:
|
|
30
28
|
raise MissingRequirementException("Cannot retrieve provider data without name")
|
|
@@ -45,10 +43,8 @@ get_provider_data_options = [
|
|
|
45
43
|
|
|
46
44
|
|
|
47
45
|
def get_provider_models(option_list: list):
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if option_flag.name == "provider_name":
|
|
51
|
-
provider_name = option_arg
|
|
46
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
47
|
+
provider_name = opts.get('provider_name')
|
|
52
48
|
|
|
53
49
|
if not provider_name:
|
|
54
50
|
raise MissingRequirementException("Cannot retrieve provider models without name")
|
|
@@ -69,16 +65,11 @@ get_provider_models_options = [
|
|
|
69
65
|
|
|
70
66
|
|
|
71
67
|
def get_model_data(option_list: list):
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
provider_name = option_arg
|
|
78
|
-
if option_flag.name == "model_name":
|
|
79
|
-
model_name = option_arg
|
|
80
|
-
if option_flag.name == "model_id":
|
|
81
|
-
model_id = option_arg
|
|
68
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
69
|
+
|
|
70
|
+
provider_name = opts.get('provider_name')
|
|
71
|
+
model_name = opts.get('model_name')
|
|
72
|
+
model_id = opts.get('model_id')
|
|
82
73
|
|
|
83
74
|
if not (provider_name and (model_name or model_id)):
|
|
84
75
|
raise MissingRequirementException("Cannot retrieve model data without provider name and model id or name.")
|
pygeai/cli/commands/migrate.py
CHANGED
|
@@ -7,7 +7,7 @@ from pygeai.core.common.exceptions import MissingRequirementException
|
|
|
7
7
|
from pygeai.core.utils.console import Console
|
|
8
8
|
from pygeai.lab.managers import AILabManager
|
|
9
9
|
from pygeai.lab.models import FilterSettings
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
from pygeai.assistant.rag.clients import RAGAssistantClient
|
|
12
12
|
from pygeai.assistant.rag.mappers import RAGAssistantMapper
|
|
13
13
|
from pygeai.core.files.managers import FileManager
|
|
@@ -112,8 +112,8 @@ def prompt_resource_selection(
|
|
|
112
112
|
|
|
113
113
|
selected_ids = [getattr(items[i-1], id_field) for i in indices]
|
|
114
114
|
return ",".join(str(sid) for sid in selected_ids)
|
|
115
|
-
except (ValueError, IndexError)
|
|
116
|
-
Console.write_stdout(
|
|
115
|
+
except (ValueError, IndexError):
|
|
116
|
+
Console.write_stdout("Error: Invalid input format. Please enter comma-separated numbers.")
|
|
117
117
|
continue
|
|
118
118
|
|
|
119
119
|
|
|
@@ -606,102 +606,46 @@ def clone_project(option_list: list) -> None:
|
|
|
606
606
|
|
|
607
607
|
:param option_list: List of (option_flag, option_value) tuples from CLI parsing
|
|
608
608
|
"""
|
|
609
|
-
|
|
610
|
-
for option_flag, option_arg in option_list:
|
|
611
|
-
if option_flag.name == "interactive":
|
|
612
|
-
interactive_mode = True
|
|
613
|
-
break
|
|
609
|
+
opts = {opt.name: arg for opt, arg in option_list}
|
|
614
610
|
|
|
615
|
-
if
|
|
611
|
+
if 'interactive' in opts:
|
|
616
612
|
clone_project_interactively()
|
|
617
613
|
return
|
|
618
614
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
if option_flag.name == "from_api_key":
|
|
654
|
-
from_api_key = option_arg
|
|
655
|
-
elif option_flag.name == "from_organization_api_key":
|
|
656
|
-
from_organization_api_key = option_arg
|
|
657
|
-
elif option_flag.name == "from_instance":
|
|
658
|
-
from_instance = option_arg
|
|
659
|
-
elif option_flag.name == "from_project_id":
|
|
660
|
-
from_project_id = option_arg
|
|
661
|
-
elif option_flag.name == "from_organization_id":
|
|
662
|
-
from_organization_id = option_arg
|
|
663
|
-
elif option_flag.name == "to_api_key":
|
|
664
|
-
to_api_key = option_arg
|
|
665
|
-
elif option_flag.name == "to_organization_api_key":
|
|
666
|
-
to_organization_api_key = option_arg
|
|
667
|
-
elif option_flag.name == "to_instance":
|
|
668
|
-
to_instance = option_arg
|
|
669
|
-
elif option_flag.name == "to_project_id":
|
|
670
|
-
to_project_id = option_arg
|
|
671
|
-
elif option_flag.name == "to_organization_id":
|
|
672
|
-
to_organization_id = option_arg
|
|
673
|
-
elif option_flag.name == "to_project_name":
|
|
674
|
-
to_project_name = option_arg
|
|
675
|
-
elif option_flag.name == "admin_email":
|
|
676
|
-
admin_email = option_arg
|
|
677
|
-
elif option_flag.name == "all":
|
|
678
|
-
migrate_all = True
|
|
679
|
-
elif option_flag.name == "agents":
|
|
680
|
-
migrate_agents = True
|
|
681
|
-
agent_ids = option_arg if option_arg else "all"
|
|
682
|
-
elif option_flag.name == "tools":
|
|
683
|
-
migrate_tools = True
|
|
684
|
-
tool_ids = option_arg if option_arg else "all"
|
|
685
|
-
elif option_flag.name == "agentic_processes":
|
|
686
|
-
migrate_processes = True
|
|
687
|
-
process_ids = option_arg if option_arg else "all"
|
|
688
|
-
elif option_flag.name == "tasks":
|
|
689
|
-
migrate_tasks = True
|
|
690
|
-
task_ids = option_arg if option_arg else "all"
|
|
691
|
-
elif option_flag.name == "usage_limits":
|
|
692
|
-
migrate_usage_limits = True
|
|
693
|
-
elif option_flag.name == "rag_assistants":
|
|
694
|
-
migrate_rag_assistants = True
|
|
695
|
-
assistant_names = option_arg if option_arg else "all"
|
|
696
|
-
elif option_flag.name == "files":
|
|
697
|
-
migrate_files = True
|
|
698
|
-
file_ids = option_arg if option_arg else "all"
|
|
699
|
-
elif option_flag.name == "secrets":
|
|
700
|
-
migrate_secrets = True
|
|
701
|
-
secret_ids = option_arg if option_arg else "all"
|
|
702
|
-
elif option_flag.name == "stop_on_error":
|
|
703
|
-
from pygeai.cli.commands.common import get_boolean_value
|
|
704
|
-
stop_on_error = get_boolean_value(option_arg)
|
|
615
|
+
from pygeai.cli.commands.common import get_boolean_value
|
|
616
|
+
|
|
617
|
+
from_api_key = opts.get('from_api_key')
|
|
618
|
+
from_organization_api_key = opts.get('from_organization_api_key')
|
|
619
|
+
from_instance = opts.get('from_instance')
|
|
620
|
+
from_project_id = opts.get('from_project_id')
|
|
621
|
+
from_organization_id = opts.get('from_organization_id')
|
|
622
|
+
to_api_key = opts.get('to_api_key')
|
|
623
|
+
to_organization_api_key = opts.get('to_organization_api_key')
|
|
624
|
+
to_instance = opts.get('to_instance')
|
|
625
|
+
to_project_id = opts.get('to_project_id')
|
|
626
|
+
to_organization_id = opts.get('to_organization_id')
|
|
627
|
+
to_project_name = opts.get('to_project_name')
|
|
628
|
+
admin_email = opts.get('admin_email')
|
|
629
|
+
|
|
630
|
+
migrate_all = 'all' in opts
|
|
631
|
+
migrate_agents = 'agents' in opts
|
|
632
|
+
migrate_tools = 'tools' in opts
|
|
633
|
+
migrate_processes = 'agentic_processes' in opts
|
|
634
|
+
migrate_tasks = 'tasks' in opts
|
|
635
|
+
migrate_usage_limits = 'usage_limits' in opts
|
|
636
|
+
migrate_rag_assistants = 'rag_assistants' in opts
|
|
637
|
+
migrate_files = 'files' in opts
|
|
638
|
+
migrate_secrets = 'secrets' in opts
|
|
639
|
+
|
|
640
|
+
agent_ids = opts.get('agents', 'all') if migrate_agents else None
|
|
641
|
+
tool_ids = opts.get('tools', 'all') if migrate_tools else None
|
|
642
|
+
process_ids = opts.get('agentic_processes', 'all') if migrate_processes else None
|
|
643
|
+
task_ids = opts.get('tasks', 'all') if migrate_tasks else None
|
|
644
|
+
assistant_names = opts.get('rag_assistants', 'all') if migrate_rag_assistants else None
|
|
645
|
+
file_ids = opts.get('files', 'all') if migrate_files else None
|
|
646
|
+
secret_ids = opts.get('secrets', 'all') if migrate_secrets else None
|
|
647
|
+
|
|
648
|
+
stop_on_error = get_boolean_value(opts.get('stop_on_error', '1'))
|
|
705
649
|
|
|
706
650
|
if not all([from_api_key, from_instance, from_project_id]):
|
|
707
651
|
raise MissingRequirementException("Source API key, instance, and project ID are required")
|
|
@@ -755,7 +699,7 @@ def clone_project(option_list: list) -> None:
|
|
|
755
699
|
Console.write_stdout(f"Creating new project '{to_project_name}'...")
|
|
756
700
|
|
|
757
701
|
org_key_to_use = to_organization_api_key or from_organization_api_key
|
|
758
|
-
logger.debug(
|
|
702
|
+
logger.debug("DEBUG: Preparing to create project with organization API key")
|
|
759
703
|
logger.debug(f" - to_organization_api_key exists: {to_organization_api_key is not None}")
|
|
760
704
|
logger.debug(f" - from_organization_api_key exists: {from_organization_api_key is not None}")
|
|
761
705
|
logger.debug(f" - Using key (first 20 chars): {org_key_to_use[:20] if org_key_to_use else 'None'}...")
|
|
@@ -779,7 +723,7 @@ def clone_project(option_list: list) -> None:
|
|
|
779
723
|
Console.write_stdout(f"Project '{to_project_name}' created successfully with ID: {to_project_id}")
|
|
780
724
|
|
|
781
725
|
from pygeai.auth.clients import AuthClient
|
|
782
|
-
Console.write_stdout(
|
|
726
|
+
Console.write_stdout("Creating project API key for new project...")
|
|
783
727
|
|
|
784
728
|
org_key_for_token_creation = to_organization_api_key or from_organization_api_key
|
|
785
729
|
auth_client = AuthClient(
|
|
@@ -797,10 +741,10 @@ def clone_project(option_list: list) -> None:
|
|
|
797
741
|
raise ValueError("Failed to create project API key")
|
|
798
742
|
|
|
799
743
|
to_api_key = token_response['id']
|
|
800
|
-
Console.write_stdout(
|
|
744
|
+
Console.write_stdout("Project API key created successfully")
|
|
801
745
|
|
|
802
746
|
if not to_organization_id:
|
|
803
|
-
Console.write_stdout(
|
|
747
|
+
Console.write_stdout("Retrieving destination organization ID...")
|
|
804
748
|
dest_admin_client = AdminClient(api_key=to_api_key, base_url=to_instance or from_instance)
|
|
805
749
|
dest_token_info = dest_admin_client.validate_api_token()
|
|
806
750
|
to_organization_id = dest_token_info.get("organizationId")
|