aiverify-moonshot 0.4.8__tar.gz → 0.4.10__tar.gz
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.
- aiverify_moonshot-0.4.10/.github/workflows/smoke-test-cli.yaml +136 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/smoke-test.yaml +3 -3
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/LICENSE.md +1 -1
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/PKG-INFO +3 -3
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/README.md +2 -2
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/__main__.py +93 -49
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/api.py +12 -10
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/metrics.py +8 -2
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/cli_errors.py +14 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/common/common.py +14 -8
- aiverify_moonshot-0.4.10/moonshot/integrations/cli/common/dataset.py +357 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/redteam/attack_module.py +30 -1
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/app.py +1 -1
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/dataset.py +52 -18
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/cookbook_response_model.py +2 -0
- aiverify_moonshot-0.4.10/moonshot/integrations/web_api/schemas/dataset_create_dto.py +28 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/recipe_response_model.py +1 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/cookbook_service.py +36 -9
- aiverify_moonshot-0.4.10/moonshot/integrations/web_api/services/dataset_service.py +70 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/recipe_service.py +33 -3
- aiverify_moonshot-0.4.10/moonshot/src/api/api_dataset.py +113 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/bookmark/bookmark.py +16 -9
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/datasets/dataset.py +37 -45
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/datasets/dataset_arguments.py +2 -1
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/messages_constants.py +1 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/attack/attack_module.py +40 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/storage/io_interface.py +18 -1
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/storage/storage.py +57 -1
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/pyproject.toml +2 -2
- aiverify_moonshot-0.4.8/moonshot/integrations/cli/common/dataset.py +0 -119
- aiverify_moonshot-0.4.8/moonshot/integrations/web_api/schemas/dataset_create_dto.py +0 -18
- aiverify_moonshot-0.4.8/moonshot/integrations/web_api/services/dataset_service.py +0 -45
- aiverify_moonshot-0.4.8/moonshot/src/api/api_dataset.py +0 -81
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.coveragerc +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.flake8 +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/pull_request_template.md +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/scripts/create_backup.sh +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/scripts/install_ms_service.sh +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/scripts/moonshot_env +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/scripts/moonshot_test_env +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/scripts/moonshot_ui_env +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/scripts/run_smoke_test.sh +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/scripts/start_ms_service.sh +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/docs-update.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/gh-event-notification.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/integration-test.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/nightly-build.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/pre-build-checks.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/pypi-deployment.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/sast-codeql.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/sca-scan.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.github/workflows/test-pypi-deployment.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.gitignore +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/.pre-commit-config.yaml +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/AUTHORS.md +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/NOTICES.md +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/__main__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/active_session_cfg.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/benchmark.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/cookbook.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/datasets.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/recipe.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/result.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/run.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/runner.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/cli.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/common/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/common/connectors.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/common/display_helper.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/common/prompt_template.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/initialisation/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/initialisation/initialisation.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/redteam/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/redteam/context_strategy.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/redteam/prompt_template.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/redteam/redteam.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/redteam/session.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/utils/process_data.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/.env.dev +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/__main__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/container.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/log/.gitkeep +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/logging_conf.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/attack_modules.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/benchmark.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/benchmark_result.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/bookmark.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/context_strategy.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/cookbook.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/endpoint.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/metric.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/prompt_template.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/recipe.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/redteam.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/routes/runner.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/benchmark_runner_dto.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/bookmark_create_dto.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/cookbook_create_dto.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/dataset_response_dto.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/endpoint_create_dto.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/endpoint_response_model.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/prompt_response_model.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/prompt_template_response_model.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/recipe_create_dto.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/session_create_dto.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/session_prompt_dto.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/schemas/session_response_model.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/attack_module_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/auto_red_team_test_manager.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/auto_red_team_test_state.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/base_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/benchmark_result_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/benchmark_test_manager.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/benchmark_test_state.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/benchmarking_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/bookmark_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/context_strategy_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/endpoint_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/metric_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/prompt_template_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/runner_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/session_service.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/utils/exceptions_handler.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/utils/file_manager.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/services/utils/results_formatter.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/status_updater/interface/benchmark_progress_callback.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/status_updater/interface/redteam_progress_callback.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/status_updater/moonshot_ui_webhook.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/temp/.gitkeep +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/web_api/types/types.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_bookmark.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_connector.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_connector_endpoint.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_context_strategy.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_cookbook.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_environment_variables.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_metrics.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_prompt_template.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_recipe.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_red_teaming.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_result.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_run.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_runner.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/api/api_session.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/bookmark/bookmark_arguments.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/configs/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/configs/env_variables.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/connectors/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/connectors/connector.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/connectors/connector_prompt_arguments.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/connectors_endpoints/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/connectors_endpoints/connector_endpoint.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/connectors_endpoints/connector_endpoint_arguments.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/cookbooks/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/cookbooks/cookbook.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/cookbooks/cookbook_arguments.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/datasets/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/metrics/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/metrics/metric.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/metrics/metric_interface.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/prompt_templates/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/prompt_templates/prompt_template.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/recipes/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/recipes/recipe.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/recipes/recipe_arguments.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/attack/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/attack/attack_module_arguments.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/attack/context_strategy.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/context_strategy/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/context_strategy/context_strategy_interface.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/session/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/session/chat.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/session/red_teaming_progress.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/session/red_teaming_type.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/redteaming/session/session.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/results/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/results/result.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/results/result_arguments.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/runners/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/runners/runner.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/runners/runner_arguments.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/runners/runner_type.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/runs/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/runs/run.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/runs/run_arguments.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/runs/run_progress.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/runs/run_status.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/storage/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/storage/db_interface.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/utils/__init__.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/utils/find_feature.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/utils/import_modules.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/utils/log.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/utils/pagination.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/src/utils/timeit.py +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/requirements.txt +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/third-party/pygments-2.18.0-py3-none-any.whl +0 -0
- {aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/third-party/text_unidecode-1.3-py2.py3-none-any.whl +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Cli Smoke Test
|
|
2
|
+
|
|
3
|
+
name: Moonshot CLI Smoke Test
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
# Runs on Pull Request Review
|
|
7
|
+
pull_request_review:
|
|
8
|
+
types: [submitted]
|
|
9
|
+
branches:
|
|
10
|
+
- 'dev_main'
|
|
11
|
+
|
|
12
|
+
# Run this workflow manually from Actions tab
|
|
13
|
+
workflow_dispatch:
|
|
14
|
+
inputs:
|
|
15
|
+
moonshot_branch:
|
|
16
|
+
description: 'Moonshot Branch / Tag Name'
|
|
17
|
+
required: true
|
|
18
|
+
default: 'dev_main'
|
|
19
|
+
type: string
|
|
20
|
+
moonshot_data_branch:
|
|
21
|
+
description: 'Moonshot Data Branch / Tag Name'
|
|
22
|
+
required: true
|
|
23
|
+
default: 'dev_main'
|
|
24
|
+
type: string
|
|
25
|
+
moonshot_ui_branch:
|
|
26
|
+
description: 'Moonshot UI Branch / Tag Name'
|
|
27
|
+
required: true
|
|
28
|
+
default: 'dev_main'
|
|
29
|
+
type: string
|
|
30
|
+
|
|
31
|
+
# Allow one concurrent deployment
|
|
32
|
+
concurrency:
|
|
33
|
+
group: ${{ github.repository }}-${{ github.workflow }}
|
|
34
|
+
cancel-in-progress: true
|
|
35
|
+
|
|
36
|
+
jobs:
|
|
37
|
+
smoke-test:
|
|
38
|
+
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
timeout-minutes: 20
|
|
41
|
+
|
|
42
|
+
steps:
|
|
43
|
+
|
|
44
|
+
- name: Checkout Moonshot (Pull Request Review)
|
|
45
|
+
if: github.event_name == 'pull_request_review'
|
|
46
|
+
uses: actions/checkout@v4
|
|
47
|
+
with:
|
|
48
|
+
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
49
|
+
ref: ${{ github.event.pull_request.head.ref }}
|
|
50
|
+
|
|
51
|
+
- name: Checkout Moonshot (Workflow Dispatch)
|
|
52
|
+
if: github.event_name == 'workflow_dispatch'
|
|
53
|
+
uses: actions/checkout@v4
|
|
54
|
+
with:
|
|
55
|
+
repository: aiverify-foundation/moonshot
|
|
56
|
+
ref: ${{ inputs.moonshot_branch }}
|
|
57
|
+
|
|
58
|
+
- name: Setup Python 3.11
|
|
59
|
+
uses: actions/setup-python@v4
|
|
60
|
+
with:
|
|
61
|
+
python-version: '3.11'
|
|
62
|
+
|
|
63
|
+
- name: Setup Moonshot
|
|
64
|
+
run: |
|
|
65
|
+
python -m venv venv
|
|
66
|
+
source venv/bin/activate
|
|
67
|
+
pip install -r requirements.txt
|
|
68
|
+
touch .env
|
|
69
|
+
echo "${{ secrets.ENVIRONMENT_VARS }}" >> .env
|
|
70
|
+
|
|
71
|
+
- name: Checkout Moonshot Data (Pull Request Review)
|
|
72
|
+
if: github.event_name == 'pull_request_review'
|
|
73
|
+
uses: actions/checkout@v4
|
|
74
|
+
with:
|
|
75
|
+
repository: aiverify-foundation/moonshot-data
|
|
76
|
+
ref: ${{ vars.MOONSHOT_DATA_BRANCH }}
|
|
77
|
+
path: moonshot-data
|
|
78
|
+
|
|
79
|
+
- name: Checkout Moonshot Data (Workflow Dispatch)
|
|
80
|
+
if: github.event_name == 'workflow_dispatch'
|
|
81
|
+
uses: actions/checkout@v4
|
|
82
|
+
with:
|
|
83
|
+
repository: aiverify-foundation/moonshot-data
|
|
84
|
+
ref: ${{ inputs.moonshot_data_branch }}
|
|
85
|
+
path: moonshot-data
|
|
86
|
+
|
|
87
|
+
- name: Setup Moonshot Data
|
|
88
|
+
run: |
|
|
89
|
+
source venv/bin/activate
|
|
90
|
+
cd moonshot-data
|
|
91
|
+
pip install -r requirements.txt
|
|
92
|
+
|
|
93
|
+
- name: Checkout Moonshot UI (Pull Request Review)
|
|
94
|
+
if: github.event_name == 'pull_request_review'
|
|
95
|
+
uses: actions/checkout@v4
|
|
96
|
+
with:
|
|
97
|
+
repository: aiverify-foundation/moonshot-ui
|
|
98
|
+
ref: ${{ vars.MOONSHOT_UI_BRANCH }}
|
|
99
|
+
path: moonshot-ui
|
|
100
|
+
|
|
101
|
+
- name: Checkout Moonshot UI (Workflow Dispatch)
|
|
102
|
+
if: github.event_name == 'workflow_dispatch'
|
|
103
|
+
uses: actions/checkout@v4
|
|
104
|
+
with:
|
|
105
|
+
repository: aiverify-foundation/moonshot-ui
|
|
106
|
+
ref: ${{ inputs.moonshot_ui_branch }}
|
|
107
|
+
path: moonshot-ui
|
|
108
|
+
|
|
109
|
+
- name: Setup Moonshot UI
|
|
110
|
+
run: |
|
|
111
|
+
cd moonshot-ui
|
|
112
|
+
npm ci
|
|
113
|
+
npm run build
|
|
114
|
+
cd ../
|
|
115
|
+
|
|
116
|
+
- name: Checkout Smoke Test
|
|
117
|
+
uses: actions/checkout@v4
|
|
118
|
+
with:
|
|
119
|
+
repository: aiverify-foundation/moonshot-smoke-testing
|
|
120
|
+
path: moonshot-smoke-testing
|
|
121
|
+
|
|
122
|
+
- name: Run Smoke Test
|
|
123
|
+
env:
|
|
124
|
+
AZURE_OPENAI_URI: ${{ secrets.AZURE_OPENAI_URI }}
|
|
125
|
+
AZURE_OPENAI_TOKEN: ${{ secrets.AZURE_OPENAI_TOKEN }}
|
|
126
|
+
ADDITIONAL_PARAMETERS: ${{ secrets.ADDITIONAL_PARAMETERS }}
|
|
127
|
+
MOONSHOT_URL: ${{ secrets.MOONSHOT_URL }}
|
|
128
|
+
MOONSHOT_PORT_NUMBER: ${{ secrets.MOONSHOT_PORT_NUMBER }}
|
|
129
|
+
CLI_DIR: ${{ secrets.CLI_DIR }}
|
|
130
|
+
run: |
|
|
131
|
+
source venv/bin/activate
|
|
132
|
+
cd moonshot-smoke-testing
|
|
133
|
+
cd tests
|
|
134
|
+
pip install python-dotenv
|
|
135
|
+
pip install pytest
|
|
136
|
+
pytest test_cli.py
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
name: Moonshot Smoke Test
|
|
4
4
|
|
|
5
5
|
on:
|
|
6
|
-
# Runs on Pull Request Review
|
|
6
|
+
# Runs on Pull Request Review
|
|
7
7
|
pull_request_review:
|
|
8
8
|
types: [submitted]
|
|
9
9
|
branches:
|
|
@@ -35,9 +35,9 @@ concurrency:
|
|
|
35
35
|
|
|
36
36
|
jobs:
|
|
37
37
|
smoke-test:
|
|
38
|
-
|
|
38
|
+
if: (github.event_name == 'pull_request_review' && github.event.pull_request.base.ref == 'dev_main') || github.event_name == 'workflow_dispatch'
|
|
39
39
|
runs-on: ubuntu-latest
|
|
40
|
-
timeout-minutes:
|
|
40
|
+
timeout-minutes: 60
|
|
41
41
|
|
|
42
42
|
steps:
|
|
43
43
|
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright
|
|
189
|
+
Copyright 2024 The Moonshot Team
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: aiverify-moonshot
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.10
|
|
4
4
|
Summary: AI Verify advances Gen AI testing with Project Moonshot.
|
|
5
5
|
Project-URL: Repository, https://github.com/aiverify-foundation/moonshot
|
|
6
6
|
Project-URL: Documentation, https://aiverify-foundation.github.io/moonshot/
|
|
@@ -46,7 +46,7 @@ Description-Content-Type: text/markdown
|
|
|
46
46
|
|
|
47
47
|

|
|
48
48
|
|
|
49
|
-
**Version 0.4.
|
|
49
|
+
**Version 0.4.10**
|
|
50
50
|
|
|
51
51
|
A simple and modular tool to evaluate any LLM application.
|
|
52
52
|
|
|
@@ -99,7 +99,7 @@ python -m moonshot -i moonshot-data -i moonshot-ui
|
|
|
99
99
|
```
|
|
100
100
|
Check out our [Installation Guide](https://aiverify-foundation.github.io/moonshot/getting_started/quick_install/) for a more details.
|
|
101
101
|
|
|
102
|
-
If you are having installation issues, see the [Troubleshooting Guide](https://aiverify-foundation.github.io/moonshot/
|
|
102
|
+
If you are having installation issues, see the [Troubleshooting Guide](https://aiverify-foundation.github.io/moonshot/faq/).
|
|
103
103
|
<details>
|
|
104
104
|
<summary><b>Other installation options</b></summary>
|
|
105
105
|
Here's a summary of other installation commands available:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
**Version 0.4.
|
|
5
|
+
**Version 0.4.10**
|
|
6
6
|
|
|
7
7
|
A simple and modular tool to evaluate any LLM application.
|
|
8
8
|
|
|
@@ -55,7 +55,7 @@ python -m moonshot -i moonshot-data -i moonshot-ui
|
|
|
55
55
|
```
|
|
56
56
|
Check out our [Installation Guide](https://aiverify-foundation.github.io/moonshot/getting_started/quick_install/) for a more details.
|
|
57
57
|
|
|
58
|
-
If you are having installation issues, see the [Troubleshooting Guide](https://aiverify-foundation.github.io/moonshot/
|
|
58
|
+
If you are having installation issues, see the [Troubleshooting Guide](https://aiverify-foundation.github.io/moonshot/faq/).
|
|
59
59
|
<details>
|
|
60
60
|
<summary><b>Other installation options</b></summary>
|
|
61
61
|
Here's a summary of other installation commands available:
|
|
@@ -116,36 +116,56 @@ def download_nltk_resources() -> None:
|
|
|
116
116
|
raise
|
|
117
117
|
|
|
118
118
|
|
|
119
|
-
def moonshot_data_installation() -> None:
|
|
120
|
-
|
|
119
|
+
def moonshot_data_installation(unattended: bool, overwrite: bool) -> None:
|
|
120
|
+
"""
|
|
121
|
+
Install Moonshot Data from GitHub.
|
|
122
|
+
|
|
123
|
+
This function clones the Moonshot Data repository from GitHub, installs its requirements,
|
|
124
|
+
and sets up the necessary environment. If the target directory already exists, it handles
|
|
125
|
+
the situation based on the 'unattended' and 'overwrite' flags.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
unattended (bool): If True, the function will not prompt the user for input.
|
|
129
|
+
overwrite (bool): If True, the existing directory will be removed before installation.
|
|
130
|
+
"""
|
|
121
131
|
logger.info("Installing Moonshot Data from GitHub")
|
|
122
132
|
repo = "https://github.com/aiverify-foundation/moonshot-data.git"
|
|
123
133
|
folder_name = repo.split("/")[-1].replace(".git", "")
|
|
134
|
+
do_install = True
|
|
124
135
|
|
|
125
|
-
# Check if the directory already exists
|
|
126
136
|
if os.path.exists(folder_name):
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
input(
|
|
130
|
-
f"Directory {folder_name} already exists. Do you want to remove it and reinstall? (Y/n): "
|
|
131
|
-
)
|
|
132
|
-
.strip()
|
|
133
|
-
.lower()
|
|
134
|
-
)
|
|
135
|
-
if user_input == "y":
|
|
136
|
-
logger.info(f"Removing directory {folder_name}.")
|
|
137
|
-
# Remove the existing directory
|
|
137
|
+
if overwrite:
|
|
138
|
+
logger.info(f"Removing directory {folder_name} due to --overwrite flag.")
|
|
138
139
|
shutil.rmtree(folder_name)
|
|
139
140
|
else:
|
|
140
|
-
logger.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
logger.warning(f"Directory {folder_name} already exists.")
|
|
142
|
+
if not unattended:
|
|
143
|
+
user_input = (
|
|
144
|
+
input(
|
|
145
|
+
f"Directory {folder_name} already exists. Do you want to remove it and reinstall? (Y/n): "
|
|
146
|
+
)
|
|
147
|
+
.strip()
|
|
148
|
+
.lower()
|
|
149
|
+
)
|
|
150
|
+
if user_input == "y":
|
|
151
|
+
logger.info(f"Removing directory {folder_name}.")
|
|
152
|
+
shutil.rmtree(folder_name)
|
|
153
|
+
else:
|
|
154
|
+
logger.info("Skipping removal of directory.")
|
|
155
|
+
do_install = False
|
|
156
|
+
else:
|
|
157
|
+
do_install = False
|
|
158
|
+
logger.info(
|
|
159
|
+
"Unattended mode detected. To reinstall, please use the --overwrite flag."
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
if do_install:
|
|
163
|
+
logger.info(f"Cloning {repo}")
|
|
164
|
+
# Clone the repository
|
|
165
|
+
run_subprocess(["git", "clone", repo], check=True)
|
|
166
|
+
|
|
167
|
+
# Create .env to point to installed folder
|
|
168
|
+
ms_lib_env_file(folder_name)
|
|
149
169
|
|
|
150
170
|
# Change directory to the folder
|
|
151
171
|
os.chdir(folder_name)
|
|
@@ -159,7 +179,6 @@ def moonshot_data_installation() -> None:
|
|
|
159
179
|
# Change back to the base directory
|
|
160
180
|
os.chdir("..")
|
|
161
181
|
|
|
162
|
-
|
|
163
182
|
def check_node() -> bool:
|
|
164
183
|
"""
|
|
165
184
|
Check if Node.js is installed on the user's machine.
|
|
@@ -176,36 +195,52 @@ def check_node() -> bool:
|
|
|
176
195
|
return False
|
|
177
196
|
|
|
178
197
|
|
|
179
|
-
def moonshot_ui_installation() -> None:
|
|
198
|
+
def moonshot_ui_installation(unattended: bool, overwrite: bool) -> None:
|
|
199
|
+
"""
|
|
200
|
+
Install Moonshot UI from GitHub.
|
|
201
|
+
"""
|
|
180
202
|
if not check_node():
|
|
181
203
|
logger.error("Node.js is not installed. Please install Node.js to proceed.")
|
|
182
204
|
return
|
|
183
205
|
|
|
184
|
-
|
|
206
|
+
logger.info("Installing Moonshot UI from GitHub")
|
|
185
207
|
repo = "https://github.com/aiverify-foundation/moonshot-ui.git"
|
|
186
208
|
folder_name = repo.split("/")[-1].replace(".git", "")
|
|
209
|
+
do_install = True
|
|
187
210
|
|
|
188
|
-
# Check if the directory already exists
|
|
189
211
|
if os.path.exists(folder_name):
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
input(
|
|
193
|
-
f"Directory {folder_name} already exists. Do you want to remove it and reinstall? (Y/n): "
|
|
194
|
-
)
|
|
195
|
-
.strip()
|
|
196
|
-
.lower()
|
|
197
|
-
)
|
|
198
|
-
if user_input == "y":
|
|
199
|
-
logger.info(f"Removing directory {folder_name}.")
|
|
200
|
-
# Remove the existing directory
|
|
212
|
+
if overwrite:
|
|
213
|
+
logger.info(f"Removing directory {folder_name} due to --overwrite flag.")
|
|
201
214
|
shutil.rmtree(folder_name)
|
|
202
215
|
else:
|
|
203
|
-
logger.
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
216
|
+
logger.warning(f"Directory {folder_name} already exists.")
|
|
217
|
+
if not unattended:
|
|
218
|
+
user_input = (
|
|
219
|
+
input(
|
|
220
|
+
f"Directory {folder_name} already exists. Do you want to remove it and reinstall? (Y/n): "
|
|
221
|
+
)
|
|
222
|
+
.strip()
|
|
223
|
+
.lower()
|
|
224
|
+
)
|
|
225
|
+
if user_input == "y":
|
|
226
|
+
logger.info(f"Removing directory {folder_name}.")
|
|
227
|
+
shutil.rmtree(folder_name)
|
|
228
|
+
else:
|
|
229
|
+
logger.info("Skipping removal of directory.")
|
|
230
|
+
do_install = False
|
|
231
|
+
else:
|
|
232
|
+
do_install = False
|
|
233
|
+
logger.info(
|
|
234
|
+
"Unattended mode detected. To reinstall, please use the --overwrite flag."
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
if do_install:
|
|
238
|
+
logger.info(f"Cloning {repo}")
|
|
239
|
+
# Clone the repository
|
|
240
|
+
run_subprocess(["git", "clone", repo], check=True)
|
|
241
|
+
|
|
242
|
+
# Create .env for UI
|
|
243
|
+
ms_ui_env_file(folder_name)
|
|
209
244
|
|
|
210
245
|
# Change directory to the folder
|
|
211
246
|
os.chdir(folder_name)
|
|
@@ -219,9 +254,6 @@ def moonshot_ui_installation() -> None:
|
|
|
219
254
|
# Change back to the base directory
|
|
220
255
|
os.chdir("..")
|
|
221
256
|
|
|
222
|
-
# Create .env for ui
|
|
223
|
-
ms_ui_env_file(folder_name)
|
|
224
|
-
|
|
225
257
|
|
|
226
258
|
def run_moonshot_ui() -> None:
|
|
227
259
|
"""
|
|
@@ -262,15 +294,27 @@ def main() -> None:
|
|
|
262
294
|
parser.add_argument(
|
|
263
295
|
"-e", "--env", type=str, help="Path to the .env file", default=".env"
|
|
264
296
|
)
|
|
297
|
+
parser.add_argument(
|
|
298
|
+
"-u",
|
|
299
|
+
"--unattended",
|
|
300
|
+
action="store_true",
|
|
301
|
+
help="Perform action without user interaction",
|
|
302
|
+
)
|
|
303
|
+
parser.add_argument(
|
|
304
|
+
"-o",
|
|
305
|
+
"--overwrite",
|
|
306
|
+
action="store_true",
|
|
307
|
+
help="Force delete and reinstall the specified module",
|
|
308
|
+
)
|
|
265
309
|
|
|
266
310
|
args = parser.parse_args()
|
|
267
311
|
|
|
268
312
|
# Handle installations based on the -i include arguments
|
|
269
313
|
if "moonshot-data" in args.install:
|
|
270
|
-
moonshot_data_installation()
|
|
314
|
+
moonshot_data_installation(args.unattended, args.overwrite)
|
|
271
315
|
|
|
272
316
|
if "moonshot-ui" in args.install:
|
|
273
|
-
moonshot_ui_installation()
|
|
317
|
+
moonshot_ui_installation(args.unattended, args.overwrite)
|
|
274
318
|
|
|
275
319
|
# If mode is not specified, skip running any modes
|
|
276
320
|
if args.mode is None:
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
from moonshot.src.api.api_bookmark import (
|
|
2
|
+
api_delete_all_bookmark,
|
|
3
|
+
api_delete_bookmark,
|
|
4
|
+
api_export_bookmarks,
|
|
5
|
+
api_get_all_bookmarks,
|
|
6
|
+
api_get_bookmark,
|
|
7
|
+
api_insert_bookmark,
|
|
8
|
+
)
|
|
1
9
|
from moonshot.src.api.api_connector import (
|
|
2
10
|
api_create_connector_from_endpoint,
|
|
3
11
|
api_create_connectors_from_endpoints,
|
|
@@ -26,10 +34,11 @@ from moonshot.src.api.api_cookbook import (
|
|
|
26
34
|
api_update_cookbook,
|
|
27
35
|
)
|
|
28
36
|
from moonshot.src.api.api_dataset import (
|
|
37
|
+
api_convert_dataset,
|
|
29
38
|
api_delete_dataset,
|
|
39
|
+
api_download_dataset,
|
|
30
40
|
api_get_all_datasets,
|
|
31
41
|
api_get_all_datasets_name,
|
|
32
|
-
api_create_datasets
|
|
33
42
|
)
|
|
34
43
|
from moonshot.src.api.api_environment_variables import api_set_environment_variables
|
|
35
44
|
from moonshot.src.api.api_metrics import (
|
|
@@ -87,14 +96,6 @@ from moonshot.src.api.api_session import (
|
|
|
87
96
|
api_update_prompt_template,
|
|
88
97
|
api_update_system_prompt,
|
|
89
98
|
)
|
|
90
|
-
from moonshot.src.api.api_bookmark import (
|
|
91
|
-
api_get_all_bookmarks,
|
|
92
|
-
api_get_bookmark,
|
|
93
|
-
api_insert_bookmark,
|
|
94
|
-
api_delete_bookmark,
|
|
95
|
-
api_delete_all_bookmark,
|
|
96
|
-
api_export_bookmarks,
|
|
97
|
-
)
|
|
98
99
|
|
|
99
100
|
__all__ = [
|
|
100
101
|
"api_create_connector_from_endpoint",
|
|
@@ -116,7 +117,8 @@ __all__ = [
|
|
|
116
117
|
"api_read_cookbook",
|
|
117
118
|
"api_read_cookbooks",
|
|
118
119
|
"api_update_cookbook",
|
|
119
|
-
"
|
|
120
|
+
"api_convert_dataset",
|
|
121
|
+
"api_download_dataset",
|
|
120
122
|
"api_delete_dataset",
|
|
121
123
|
"api_get_all_datasets",
|
|
122
124
|
"api_get_all_datasets_name",
|
{aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/benchmark/metrics.py
RENAMED
|
@@ -170,9 +170,15 @@ def _display_metrics(metrics_list: list):
|
|
|
170
170
|
table.add_column("No.", width=2)
|
|
171
171
|
table.add_column("Metric", justify="left", width=78)
|
|
172
172
|
for idx, metric in enumerate(metrics_list, 1):
|
|
173
|
-
id, name, description, *other_args = metric.values()
|
|
173
|
+
id, name, description, endpoints, configurations, *other_args = metric.values()
|
|
174
174
|
idx = metric.get("idx", idx)
|
|
175
|
-
result_info =
|
|
175
|
+
result_info = (
|
|
176
|
+
f"[red]Id: {id}[/red]\n\n"
|
|
177
|
+
f"[blue]Name: {name}[/blue]\n\n"
|
|
178
|
+
f"[blue]Description: {description}[/blue]\n\n"
|
|
179
|
+
f"[blue]Endpoints: {endpoints}[/blue]\n\n"
|
|
180
|
+
f"[blue]Configurations:{configurations}[/blue]\n\n"
|
|
181
|
+
)
|
|
176
182
|
|
|
177
183
|
table.add_section()
|
|
178
184
|
table.add_row(str(idx), result_info)
|
{aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/cli_errors.py
RENAMED
|
@@ -509,3 +509,17 @@ ERROR_RED_TEAMING_ADD_BOOKMARK_NO_ACTIVE_SESSION = (
|
|
|
509
509
|
ERROR_RED_TEAMING_USE_BOOKMARK_NO_ACTIVE_SESSION = (
|
|
510
510
|
"There is no active session. Activate a session to bookmark a prompt."
|
|
511
511
|
)
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
# ------------------------------------------------------------------------------
|
|
515
|
+
# Redteaming - list_attack_modules
|
|
516
|
+
# ------------------------------------------------------------------------------
|
|
517
|
+
ERROR_RED_TEAMING_LIST_ATTACK_MODULES_FIND_VALIDATION = (
|
|
518
|
+
"Invalid type for parameter: find. Expecting type str."
|
|
519
|
+
)
|
|
520
|
+
ERROR_RED_TEAMING_LIST_ATTACK_MODULES_PAGINATION_VALIDATION = (
|
|
521
|
+
"Invalid type for parameter: pagination. Expecting type str."
|
|
522
|
+
)
|
|
523
|
+
ERROR_RED_TEAMING_LIST_ATTACK_MODULES_PAGINATION_VALIDATION_1 = (
|
|
524
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
525
|
+
)
|
{aiverify_moonshot-0.4.8 → aiverify_moonshot-0.4.10}/moonshot/integrations/cli/common/common.py
RENAMED
|
@@ -2,10 +2,6 @@ import argparse
|
|
|
2
2
|
|
|
3
3
|
import cmd2
|
|
4
4
|
|
|
5
|
-
from moonshot.integrations.cli.common.dataset import (
|
|
6
|
-
add_dataset,
|
|
7
|
-
add_dataset_args
|
|
8
|
-
)
|
|
9
5
|
from moonshot.integrations.cli.common.connectors import (
|
|
10
6
|
add_endpoint,
|
|
11
7
|
add_endpoint_args,
|
|
@@ -20,6 +16,12 @@ from moonshot.integrations.cli.common.connectors import (
|
|
|
20
16
|
view_endpoint,
|
|
21
17
|
view_endpoint_args,
|
|
22
18
|
)
|
|
19
|
+
from moonshot.integrations.cli.common.dataset import (
|
|
20
|
+
convert_dataset,
|
|
21
|
+
convert_dataset_args,
|
|
22
|
+
download_dataset,
|
|
23
|
+
download_dataset_args,
|
|
24
|
+
)
|
|
23
25
|
from moonshot.integrations.cli.common.prompt_template import (
|
|
24
26
|
delete_prompt_template,
|
|
25
27
|
delete_prompt_template_args,
|
|
@@ -60,10 +62,14 @@ class CommonCommandSet(cmd2.CommandSet):
|
|
|
60
62
|
def do_add_endpoint(self, args: argparse.Namespace) -> None:
|
|
61
63
|
add_endpoint(args)
|
|
62
64
|
|
|
63
|
-
@cmd2.with_argparser(
|
|
64
|
-
def
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
@cmd2.with_argparser(convert_dataset_args)
|
|
66
|
+
def do_convert_dataset(self, args: argparse.Namespace) -> None:
|
|
67
|
+
convert_dataset(args)
|
|
68
|
+
|
|
69
|
+
@cmd2.with_argparser(download_dataset_args)
|
|
70
|
+
def do_download_dataset(self, args: argparse.Namespace) -> None:
|
|
71
|
+
download_dataset(args)
|
|
72
|
+
|
|
67
73
|
# ------------------------------------------------------------------------------
|
|
68
74
|
# Delete contents
|
|
69
75
|
# ------------------------------------------------------------------------------
|