aiverify-moonshot 0.4.1__tar.gz → 0.4.3__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.
Files changed (192) hide show
  1. aiverify_moonshot-0.4.3/.github/pull_request_template.md +88 -0
  2. aiverify_moonshot-0.4.3/.github/workflows/sca_scan.yaml +64 -0
  3. aiverify_moonshot-0.4.3/.github/workflows/smoke-test.yaml +127 -0
  4. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/.pre-commit-config.yaml +5 -1
  5. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/PKG-INFO +2 -2
  6. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/README.md +1 -1
  7. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/__main__.py +77 -35
  8. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/api.py +16 -0
  9. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/benchmark.py +29 -13
  10. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/cookbook.py +62 -24
  11. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/datasets.py +79 -40
  12. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/metrics.py +62 -23
  13. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/recipe.py +89 -69
  14. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/result.py +85 -47
  15. aiverify_moonshot-0.4.3/moonshot/integrations/cli/benchmark/run.py +180 -0
  16. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/common.py +20 -6
  17. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/connectors.py +154 -74
  18. aiverify_moonshot-0.4.3/moonshot/integrations/cli/common/dataset.py +66 -0
  19. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/prompt_template.py +57 -19
  20. aiverify_moonshot-0.4.3/moonshot/integrations/cli/redteam/attack_module.py +136 -0
  21. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/context_strategy.py +83 -23
  22. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/prompt_template.py +1 -1
  23. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/redteam.py +52 -6
  24. aiverify_moonshot-0.4.3/moonshot/integrations/cli/redteam/session.py +1000 -0
  25. aiverify_moonshot-0.4.3/moonshot/integrations/cli/utils/process_data.py +52 -0
  26. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/__main__.py +2 -0
  27. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/app.py +6 -6
  28. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/container.py +12 -2
  29. aiverify_moonshot-0.4.3/moonshot/integrations/web_api/routes/bookmark.py +173 -0
  30. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/dataset.py +46 -1
  31. aiverify_moonshot-0.4.3/moonshot/integrations/web_api/schemas/bookmark_create_dto.py +13 -0
  32. aiverify_moonshot-0.4.3/moonshot/integrations/web_api/schemas/dataset_create_dto.py +18 -0
  33. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/recipe_create_dto.py +0 -2
  34. aiverify_moonshot-0.4.3/moonshot/integrations/web_api/services/bookmark_service.py +94 -0
  35. aiverify_moonshot-0.4.3/moonshot/integrations/web_api/services/dataset_service.py +45 -0
  36. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/recipe_service.py +0 -1
  37. aiverify_moonshot-0.4.3/moonshot/integrations/web_api/services/utils/file_manager.py +52 -0
  38. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/status_updater/moonshot_ui_webhook.py +0 -1
  39. aiverify_moonshot-0.4.3/moonshot/src/api/api_bookmark.py +95 -0
  40. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_connector_endpoint.py +1 -1
  41. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_context_strategy.py +2 -2
  42. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_dataset.py +35 -0
  43. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_recipe.py +0 -3
  44. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_session.py +1 -1
  45. aiverify_moonshot-0.4.3/moonshot/src/bookmark/bookmark.py +257 -0
  46. aiverify_moonshot-0.4.3/moonshot/src/bookmark/bookmark_arguments.py +38 -0
  47. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/configs/env_variables.py +12 -2
  48. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/connectors/connector.py +15 -7
  49. aiverify_moonshot-0.4.3/moonshot/src/connectors_endpoints/connector_endpoint.py +227 -0
  50. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/cookbooks/cookbook.py +57 -37
  51. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/datasets/dataset.py +125 -5
  52. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/metrics/metric.py +8 -4
  53. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/metrics/metric_interface.py +8 -2
  54. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/prompt_templates/prompt_template.py +5 -1
  55. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/recipes/recipe.py +38 -40
  56. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/recipes/recipe_arguments.py +0 -4
  57. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/attack/attack_module.py +18 -8
  58. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/attack/context_strategy.py +6 -2
  59. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/session/session.py +15 -11
  60. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/results/result.py +7 -3
  61. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/runners/runner.py +65 -42
  62. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/runs/run.py +15 -11
  63. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/runs/run_progress.py +7 -3
  64. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/storage/db_interface.py +14 -0
  65. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/storage/storage.py +33 -2
  66. aiverify_moonshot-0.4.3/moonshot/src/utils/__init__.py +0 -0
  67. aiverify_moonshot-0.4.3/moonshot/src/utils/find_feature.py +45 -0
  68. aiverify_moonshot-0.4.3/moonshot/src/utils/log.py +72 -0
  69. aiverify_moonshot-0.4.3/moonshot/src/utils/pagination.py +25 -0
  70. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/utils/timeit.py +8 -1
  71. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/pyproject.toml +17 -2
  72. aiverify_moonshot-0.4.1/moonshot/integrations/cli/benchmark/run.py +0 -140
  73. aiverify_moonshot-0.4.1/moonshot/integrations/cli/redteam/attack_module.py +0 -70
  74. aiverify_moonshot-0.4.1/moonshot/integrations/cli/redteam/session.py +0 -479
  75. aiverify_moonshot-0.4.1/moonshot/integrations/web_api/services/dataset_service.py +0 -20
  76. aiverify_moonshot-0.4.1/moonshot/src/connectors_endpoints/connector_endpoint.py +0 -211
  77. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/.coveragerc +0 -0
  78. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/.flake8 +0 -0
  79. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/.gitignore +0 -0
  80. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/AUTHORS.md +0 -0
  81. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/LICENSE.md +0 -0
  82. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/NOTICES.md +0 -0
  83. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/__init__.py +0 -0
  84. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/__init__.py +0 -0
  85. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/__init__.py +0 -0
  86. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/__main__.py +0 -0
  87. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/active_session_cfg.py +0 -0
  88. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/__init__.py +0 -0
  89. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/runner.py +0 -0
  90. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/cli.py +0 -0
  91. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/__init__.py +0 -0
  92. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/display_helper.py +0 -0
  93. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/initialisation/__init__.py +0 -0
  94. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/initialisation/initialisation.py +0 -0
  95. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/__init__.py +0 -0
  96. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/.env.dev +0 -0
  97. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/__init__.py +0 -0
  98. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/log/.gitkeep +0 -0
  99. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/logging_conf.py +0 -0
  100. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/__init__.py +0 -0
  101. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/attack_modules.py +0 -0
  102. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/benchmark.py +0 -0
  103. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/benchmark_result.py +0 -0
  104. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/context_strategy.py +0 -0
  105. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/cookbook.py +0 -0
  106. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/endpoint.py +0 -0
  107. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/metric.py +0 -0
  108. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/prompt_template.py +0 -0
  109. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/recipe.py +0 -0
  110. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/redteam.py +0 -0
  111. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/runner.py +0 -0
  112. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/__init__.py +0 -0
  113. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/benchmark_runner_dto.py +0 -0
  114. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/cookbook_create_dto.py +0 -0
  115. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/cookbook_response_model.py +0 -0
  116. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/dataset_response_dto.py +0 -0
  117. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/endpoint_create_dto.py +0 -0
  118. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/endpoint_response_model.py +0 -0
  119. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/prompt_response_model.py +0 -0
  120. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/prompt_template_response_model.py +0 -0
  121. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/recipe_response_model.py +0 -0
  122. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/session_create_dto.py +0 -0
  123. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/session_prompt_dto.py +0 -0
  124. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/session_response_model.py +0 -0
  125. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/__init__.py +0 -0
  126. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/attack_module_service.py +0 -0
  127. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/auto_red_team_test_manager.py +0 -0
  128. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/auto_red_team_test_state.py +0 -0
  129. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/base_service.py +0 -0
  130. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/benchmark_result_service.py +0 -0
  131. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/benchmark_test_manager.py +0 -0
  132. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/benchmark_test_state.py +0 -0
  133. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/benchmarking_service.py +0 -0
  134. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/context_strategy_service.py +0 -0
  135. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/cookbook_service.py +0 -0
  136. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/endpoint_service.py +0 -0
  137. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/metric_service.py +0 -0
  138. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/prompt_template_service.py +0 -0
  139. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/runner_service.py +0 -0
  140. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/session_service.py +0 -0
  141. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/utils/exceptions_handler.py +0 -0
  142. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/utils/results_formatter.py +0 -0
  143. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/status_updater/interface/benchmark_progress_callback.py +0 -0
  144. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/status_updater/interface/redteam_progress_callback.py +0 -0
  145. /aiverify_moonshot-0.4.1/moonshot/src/__init__.py → /aiverify_moonshot-0.4.3/moonshot/integrations/web_api/temp/.gitkeep +0 -0
  146. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/types/types.py +0 -0
  147. {aiverify_moonshot-0.4.1/moonshot/src/api → aiverify_moonshot-0.4.3/moonshot/src}/__init__.py +0 -0
  148. {aiverify_moonshot-0.4.1/moonshot/src/configs → aiverify_moonshot-0.4.3/moonshot/src/api}/__init__.py +0 -0
  149. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_connector.py +0 -0
  150. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_cookbook.py +0 -0
  151. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_environment_variables.py +0 -0
  152. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_metrics.py +0 -0
  153. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_prompt_template.py +0 -0
  154. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_red_teaming.py +0 -0
  155. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_result.py +0 -0
  156. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_run.py +0 -0
  157. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_runner.py +0 -0
  158. {aiverify_moonshot-0.4.1/moonshot/src/connectors → aiverify_moonshot-0.4.3/moonshot/src/configs}/__init__.py +0 -0
  159. {aiverify_moonshot-0.4.1/moonshot/src/connectors_endpoints → aiverify_moonshot-0.4.3/moonshot/src/connectors}/__init__.py +0 -0
  160. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/connectors/connector_prompt_arguments.py +0 -0
  161. {aiverify_moonshot-0.4.1/moonshot/src/cookbooks → aiverify_moonshot-0.4.3/moonshot/src/connectors_endpoints}/__init__.py +0 -0
  162. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/connectors_endpoints/connector_endpoint_arguments.py +0 -0
  163. {aiverify_moonshot-0.4.1/moonshot/src/datasets → aiverify_moonshot-0.4.3/moonshot/src/cookbooks}/__init__.py +0 -0
  164. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/cookbooks/cookbook_arguments.py +0 -0
  165. {aiverify_moonshot-0.4.1/moonshot/src/metrics → aiverify_moonshot-0.4.3/moonshot/src/datasets}/__init__.py +0 -0
  166. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/datasets/dataset_arguments.py +0 -0
  167. {aiverify_moonshot-0.4.1/moonshot/src/prompt_templates → aiverify_moonshot-0.4.3/moonshot/src/metrics}/__init__.py +0 -0
  168. {aiverify_moonshot-0.4.1/moonshot/src/recipes → aiverify_moonshot-0.4.3/moonshot/src/prompt_templates}/__init__.py +0 -0
  169. {aiverify_moonshot-0.4.1/moonshot/src/redteaming → aiverify_moonshot-0.4.3/moonshot/src/recipes}/__init__.py +0 -0
  170. {aiverify_moonshot-0.4.1/moonshot/src/redteaming/attack → aiverify_moonshot-0.4.3/moonshot/src/redteaming}/__init__.py +0 -0
  171. {aiverify_moonshot-0.4.1/moonshot/src/redteaming/context_strategy → aiverify_moonshot-0.4.3/moonshot/src/redteaming/attack}/__init__.py +0 -0
  172. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/attack/attack_module_arguments.py +0 -0
  173. {aiverify_moonshot-0.4.1/moonshot/src/redteaming/session → aiverify_moonshot-0.4.3/moonshot/src/redteaming/context_strategy}/__init__.py +0 -0
  174. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/context_strategy/context_strategy_interface.py +0 -0
  175. {aiverify_moonshot-0.4.1/moonshot/src/results → aiverify_moonshot-0.4.3/moonshot/src/redteaming/session}/__init__.py +0 -0
  176. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/session/chat.py +0 -0
  177. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/session/red_teaming_progress.py +0 -0
  178. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/session/red_teaming_type.py +0 -0
  179. {aiverify_moonshot-0.4.1/moonshot/src/runners → aiverify_moonshot-0.4.3/moonshot/src/results}/__init__.py +0 -0
  180. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/results/result_arguments.py +0 -0
  181. {aiverify_moonshot-0.4.1/moonshot/src/runs → aiverify_moonshot-0.4.3/moonshot/src/runners}/__init__.py +0 -0
  182. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/runners/runner_arguments.py +0 -0
  183. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/runners/runner_type.py +0 -0
  184. {aiverify_moonshot-0.4.1/moonshot/src/storage → aiverify_moonshot-0.4.3/moonshot/src/runs}/__init__.py +0 -0
  185. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/runs/run_arguments.py +0 -0
  186. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/runs/run_status.py +0 -0
  187. {aiverify_moonshot-0.4.1/moonshot/src/utils → aiverify_moonshot-0.4.3/moonshot/src/storage}/__init__.py +0 -0
  188. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/storage/io_interface.py +0 -0
  189. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/moonshot/src/utils/import_modules.py +0 -0
  190. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/requirements.txt +0 -0
  191. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/third-party/pygments-2.18.0-py3-none-any.whl +0 -0
  192. {aiverify_moonshot-0.4.1 → aiverify_moonshot-0.4.3}/third-party/text_unidecode-1.3-py2.py3-none-any.whl +0 -0
@@ -0,0 +1,88 @@
1
+ ## Description
2
+
3
+ [Provide a brief description of the changes or features introduced by this pull request.]
4
+
5
+ ## Motivation and Context
6
+
7
+ [Explain the motivation or the context behind this pull request. Why is it necessary?]
8
+
9
+ ## Type of Change
10
+
11
+ <!-- Select the appropriate type of change: -->
12
+ <!-- - feat: A new feature -->
13
+ <!-- - fix: A bug fix -->
14
+ <!-- - chore: Routine tasks, maintenance, or tooling changes -->
15
+ <!-- - docs: Documentation updates -->
16
+ <!-- - style: Code style changes (e.g., formatting, indentation) -->
17
+ <!-- - refactor: Code refactoring without changes in functionality -->
18
+ <!-- - test: Adding or modifying tests -->
19
+ <!-- - perf: Performance improvements -->
20
+ <!-- - ci: Changes to the CI/CD configuration or scripts -->
21
+ <!-- - other: Other changes that don't fit into the above categories -->
22
+
23
+ ## How to Test
24
+
25
+ [Provide clear instructions on how to test and verify the changes introduced by this pull request, including any specific unit tests you have created to demonstrate your changes.]
26
+
27
+ ## Checklist
28
+
29
+ Please check all the boxes that apply to this pull request using "x":
30
+
31
+ - [ ] I have tested the changes locally and verified that they work as expected.
32
+ - [ ] I have added or updated the necessary documentation (README, API docs, etc.).
33
+ - [ ] I have added appropriate unit tests or functional tests for the changes made.
34
+ - [ ] I have followed the project's coding conventions and style guidelines.
35
+ - [ ] I have rebased my branch onto the latest commit of the main branch.
36
+ - [ ] I have squashed or reorganized my commits into logical units.
37
+ - [ ] I have added any necessary dependencies or packages to the project's build configuration.
38
+ - [ ] I have performed a self-review of my own code.
39
+ - [ ] I have read, understood and agree to the Developer Certificate of Origin below, which this project utilises.
40
+
41
+ ## Screenshots (if applicable)
42
+
43
+ [If the changes involve visual modifications, include screenshots or GIFs that demonstrate the changes.]
44
+
45
+ ## Additional Notes
46
+
47
+ [Add any additional information or context that might be relevant to reviewers.]
48
+
49
+ <details>
50
+ <summary>Developer Certificate of Origin</summary>
51
+
52
+ ```
53
+ Developer Certificate of Origin
54
+ Version 1.1
55
+
56
+ Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
57
+
58
+ Everyone is permitted to copy and distribute verbatim copies of this
59
+ license document, but changing it is not allowed.
60
+
61
+
62
+ Developer's Certificate of Origin 1.1
63
+
64
+ By making a contribution to this project, I certify that:
65
+
66
+ (a) The contribution was created in whole or in part by me and I
67
+ have the right to submit it under the open source license
68
+ indicated in the file; or
69
+
70
+ (b) The contribution is based upon previous work that, to the best
71
+ of my knowledge, is covered under an appropriate open source
72
+ license and I have the right under that license to submit that
73
+ work with modifications, whether created in whole or in part
74
+ by me, under the same open source license (unless I am
75
+ permitted to submit under a different license), as indicated
76
+ in the file; or
77
+
78
+ (c) The contribution was provided directly to me by some other
79
+ person who certified (a), (b) or (c) and I have not modified
80
+ it.
81
+
82
+ (d) I understand and agree that this project and the contribution
83
+ are public and that a record of the contribution (including all
84
+ personal information I submit with it, including my sign-off) is
85
+ maintained indefinitely and may be redistributed consistent with
86
+ this project or the open source license(s) involved.
87
+ ```
88
+ </details>
@@ -0,0 +1,64 @@
1
+ name: Software Composition Analysis
2
+
3
+ # Runs when a pull request review is being submitted
4
+ on:
5
+ pull_request:
6
+
7
+ # Run this workflow manually from Actions tab
8
+ workflow_dispatch:
9
+ inputs:
10
+ branch_to_test:
11
+ description: 'Branch or tag to run test'
12
+ required: true
13
+ default: 'main'
14
+ type: string
15
+
16
+ # Allow one concurrent deployment
17
+ concurrency:
18
+ group: ${{ github.repository }}-${{ github.workflow }}
19
+ cancel-in-progress: true
20
+
21
+ jobs:
22
+ software-composition-analysis:
23
+
24
+ runs-on: ubuntu-latest
25
+ timeout-minutes: 10
26
+
27
+ steps:
28
+
29
+ - name: Checkout Code (Pull_Request)
30
+ # if: github.event_name == 'pull_request'
31
+ uses: actions/checkout@v3
32
+ with:
33
+ ref: ${{ github.event.pull_request.head.ref }}
34
+ repository: ${{ github.event.pull_request.head.repo.full_name }}
35
+ submodules: recursive
36
+
37
+ - name: Checkout Code (Workflow_Dispatch)
38
+ if: github.event_name == 'workflow_dispatch'
39
+ uses: actions/checkout@v3
40
+ with:
41
+ ref: ${{ inputs.branch_to_test }}
42
+
43
+ - name: Set Branch Variable (Pull_Request)
44
+ # if: github.event_name == 'pull_request'
45
+ run: |
46
+ echo "BRANCH=branch" >> "$GITHUB_ENV"
47
+
48
+ - name: Set Branch Variable (Workflow_Dispatch)
49
+ if: github.event_name == 'workflow_dispatch'
50
+ run: |
51
+ echo "BRANCH=${{ inputs.branch_to_test }}" >> "$GITHUB_ENV"
52
+
53
+ - name: Setup Python 3.11
54
+ uses: actions/setup-python@v5
55
+ with:
56
+ python-version: "3.11"
57
+
58
+ - name: Install & Scan MOONSHOT
59
+ run: |
60
+ python -m venv venv
61
+ source venv/bin/activate
62
+ pip install -r requirements.txt
63
+ bash <(curl -s -L https://detect.synopsys.com/detect9.sh) --blackduck.url=https://blackduck.aipo-imda.net/ --blackduck.api.token=${{ secrets.BLACKDUCK_TOKEN }} --detect.detector.search.depth=10 --detect.project.name=aiverify-moonshot --detect.project.version.name=$BRANCH --detect.source.path=. --detect.code.location.name="aiverify-moonshot_$BRANCH" --detect.excluded.directories=/tests --blackduck.trust.cert=true --detect.excluded.detector.types=POETRY
64
+ cd ../
@@ -0,0 +1,127 @@
1
+ # Smoke Test
2
+
3
+ name: Moonshot Smoke Test
4
+
5
+ on:
6
+ # Runs on Pull Request
7
+ pull_request:
8
+ # types: [submitted]
9
+ # branches:
10
+ # - '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: 'main'
19
+ type: string
20
+ moonshot_data_branch:
21
+ description: 'Moonshot Data Branch / Tag Name'
22
+ required: true
23
+ default: 'main'
24
+ type: string
25
+ moonshot_ui_branch:
26
+ description: 'Moonshot UI Branch / Tag Name'
27
+ required: true
28
+ default: '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)
45
+ if: github.event_name == 'pull_request'
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-data
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
+
69
+ - name: Checkout Moonshot Data (Pull Request)
70
+ if: github.event_name == 'pull_request'
71
+ uses: actions/checkout@v4
72
+ with:
73
+ repository: aiverify-foundation/moonshot-data
74
+ ref: ${{ vars.MOONSHOT_DATA_BRANCH }}
75
+ path: moonshot-data
76
+
77
+ - name: Checkout Moonshot Data (Workflow Dispatch)
78
+ if: github.event_name == 'workflow_dispatch'
79
+ uses: actions/checkout@v4
80
+ with:
81
+ repository: aiverify-foundation/moonshot-data
82
+ ref: ${{ inputs.moonshot_data_branch }}
83
+ path: moonshot-data
84
+
85
+ - name: Setup Moonshot Data
86
+ run: |
87
+ source venv/bin/activate
88
+ cd moonshot-data
89
+ pip install -r requirements.txt
90
+
91
+ - name: Checkout Moonshot UI (Pull Request)
92
+ if: github.event_name == 'pull_request'
93
+ uses: actions/checkout@v4
94
+ with:
95
+ repository: aiverify-foundation/moonshot-ui
96
+ ref: ${{ vars.MOONSHOT_UI_BRANCH }}
97
+ path: moonshot-ui
98
+
99
+ - name: Checkout Moonshot UI (Workflow Dispatch)
100
+ if: github.event_name == 'workflow_dispatch'
101
+ uses: actions/checkout@v4
102
+ with:
103
+ repository: aiverify-foundation/moonshot-ui
104
+ ref: ${{ inputs.moonshot_ui_branch }}
105
+ path: moonshot-ui
106
+
107
+ - name: Setup Moonshot UI
108
+ run: |
109
+ cd moonshot-ui
110
+ npm ci
111
+ npm run build
112
+ cd ../
113
+ source venv/bin/activate
114
+ python -m moonshot web &
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
+ run: |
124
+ cd moonshot-smoke-testing
125
+ npm ci
126
+ npx playwright install --with-deps
127
+ npx playwright test tests/main-page.spec.ts
@@ -17,4 +17,8 @@ repos:
17
17
  hooks:
18
18
  - id: flake8
19
19
  name: flake8 - Python linting
20
- exclude: ^tests
20
+ exclude: ^tests
21
+ - repo: https://github.com/gitleaks/gitleaks
22
+ rev: v8.18.4
23
+ hooks:
24
+ - id: gitleaks
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aiverify-moonshot
3
- Version: 0.4.1
3
+ Version: 0.4.3
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/
@@ -43,7 +43,7 @@ Description-Content-Type: text/markdown
43
43
 
44
44
  ![Moonshot Logo](https://github.com/aiverify-foundation/moonshot/raw/main/misc/aiverify-moonshot-logo.png)
45
45
 
46
- **Version 0.4.1**
46
+ **Version 0.4.3**
47
47
 
48
48
  A simple and modular tool to evaluate any LLM application.
49
49
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ![Moonshot Logo](https://github.com/aiverify-foundation/moonshot/raw/main/misc/aiverify-moonshot-logo.png)
4
4
 
5
- **Version 0.4.1**
5
+ **Version 0.4.3**
6
6
 
7
7
  A simple and modular tool to evaluate any LLM application.
8
8
 
@@ -1,15 +1,24 @@
1
- import sys
2
- import warnings
3
1
  import argparse
2
+ import os
4
3
  import platform
5
4
  import subprocess
6
- import os
7
- import threading
5
+ import sys
6
+ import threading
7
+ import warnings
8
+
8
9
  from dotenv import dotenv_values
10
+
9
11
  from moonshot.api import api_set_environment_variables
12
+ from moonshot.src.utils.log import configure_logger
13
+
14
+ # Create a logger for this module
15
+ logger = configure_logger(__name__)
16
+
10
17
  """
11
18
  Run the Moonshot application
12
19
  """
20
+
21
+
13
22
  def run_subprocess(*args, **kwargs):
14
23
  """
15
24
  Run a subprocess with the option to use shell=True on Windows.
@@ -18,6 +27,7 @@ def run_subprocess(*args, **kwargs):
18
27
  kwargs["shell"] = True
19
28
  return subprocess.run(*args, **kwargs)
20
29
 
30
+
21
31
  def ms_lib_env_file(data_repo_name):
22
32
  """
23
33
  Writes the env file to be used for moonshot library
@@ -25,6 +35,7 @@ def ms_lib_env_file(data_repo_name):
25
35
  env_content_data = f"""
26
36
  # For Data
27
37
  ATTACK_MODULES="./{data_repo_name}/attack-modules"
38
+ BOOKMARKS="./{data_repo_name}/generated-outputs/bookmarks"
28
39
  CONNECTORS="./{data_repo_name}/connectors"
29
40
  CONNECTORS_ENDPOINTS="./{data_repo_name}/connectors-endpoints"
30
41
  CONTEXT_STRATEGY="./{data_repo_name}/context-strategy"
@@ -40,7 +51,7 @@ def ms_lib_env_file(data_repo_name):
40
51
  RESULTS_MODULES="./{data_repo_name}/results-modules"
41
52
  RUNNERS="./{data_repo_name}/generated-outputs/runners"
42
53
  RUNNERS_MODULES="./{data_repo_name}/runners-modules"
43
- TOKENIZERS_PARALLELISM = false
54
+ TOKENIZERS_PARALLELISM = false
44
55
  """
45
56
 
46
57
  env_content_web_api = """
@@ -58,6 +69,7 @@ def ms_lib_env_file(data_repo_name):
58
69
  combined_content = env_content_data + env_content_web_api
59
70
  env_file.write(combined_content.strip())
60
71
 
72
+
61
73
  def ms_ui_env_file(ui_repo):
62
74
  """
63
75
  Write the env file to be used with moonshot ui
@@ -71,67 +83,73 @@ def ms_ui_env_file(ui_repo):
71
83
  with open(os.path.join(ui_repo, ".env"), "w") as env_file:
72
84
  env_file.write(env_content.strip())
73
85
 
86
+
74
87
  def moonshot_data_installation():
75
88
  # Code for moonshot-data installation
76
- print("Installing Moonshot Data from GitHub")
89
+ logger.info("Installing Moonshot Data from GitHub")
77
90
  repo = "https://github.com/aiverify-foundation/moonshot-data.git"
78
91
  folder_name = repo.split("/")[-1].replace(".git", "")
79
-
92
+
80
93
  # Check if the directory already exists
81
94
  if not os.path.exists(folder_name):
82
- print(f"Cloning {repo}")
95
+ logger.info(f"Cloning {repo}")
83
96
  # Clone the repository
84
97
  run_subprocess(["git", "clone", repo], check=True)
85
-
98
+
86
99
  # Create .env to point to installed folder
87
100
  ms_lib_env_file(folder_name)
88
-
101
+
89
102
  # Change directory to the folder
90
103
  os.chdir(folder_name)
91
104
 
92
- print(f"Installing requirements for {folder_name}")
105
+ logger.info(f"Installing requirements for {folder_name}")
93
106
  # Install the requirements if they exist
94
107
  if os.path.exists("requirements.txt"):
95
108
  run_subprocess(["pip", "install", "-r", "requirements.txt"], check=True)
96
109
  import nltk
97
- nltk.download('punkt')
98
- nltk.download('stopwords')
99
- nltk.download('averaged_perceptron_tagger')
100
- nltk.download('universal_tagset')
101
-
110
+
111
+ nltk.download("punkt")
112
+ nltk.download("stopwords")
113
+ nltk.download("averaged_perceptron_tagger")
114
+ nltk.download("universal_tagset")
115
+
102
116
  # Change back to the base directory
103
117
  os.chdir("..")
104
118
 
105
119
  else:
106
- print(f"Directory {folder_name} already exists, skipping clone.")
120
+ logger.warning(f"Directory {folder_name} already exists, skipping clone.")
121
+
107
122
 
108
123
  def moonshot_ui_installation():
109
124
  # Code for moonshot-ui installation
110
125
  repo = "https://github.com/aiverify-foundation/moonshot-ui.git"
111
126
  folder_name = repo.split("/")[-1].replace(".git", "")
112
-
127
+
113
128
  # Check if the directory already exists
114
129
  if not os.path.exists(folder_name):
115
- print(f"Cloning {repo}")
130
+ logger.info(f"Cloning {repo}")
116
131
  # Clone the repository
117
132
  run_subprocess(["git", "clone", repo], check=True)
118
133
 
119
134
  # Change directory to the folder
120
135
  os.chdir(folder_name)
121
136
 
122
- print(f"Installing requirements for {folder_name}")
137
+ logger.info(f"Installing requirements for {folder_name}")
123
138
  # Install the requirements if they exist
124
139
  if os.path.exists("package.json"):
125
140
  run_subprocess(["npm", "install"], check=True)
126
141
  run_subprocess(["npm", "run", "build"], check=True)
127
-
142
+
128
143
  # Change back to the base directory
129
144
  os.chdir("..")
130
145
 
131
146
  # Create .env for ui
132
147
  ms_ui_env_file(folder_name)
133
148
  else:
134
- print(f"Directory {folder_name} already exists, skipping installation.")
149
+ logger.warning(
150
+ f"Directory {folder_name} already exists, skipping installation."
151
+ )
152
+
135
153
 
136
154
  def run_moonshot_ui_dev():
137
155
  """
@@ -141,31 +159,51 @@ def run_moonshot_ui_dev():
141
159
  ui_dev_dir = os.path.join(base_directory, "moonshot-ui")
142
160
 
143
161
  if not os.path.exists(ui_dev_dir):
144
- print("moonshot-ui does not exist. Please run with '-i moonshot-ui' to install moonshot-ui first.")
162
+ logger.error(
163
+ "moonshot-ui does not exist. Please run with '-i moonshot-ui' to install moonshot-ui first."
164
+ )
145
165
  sys.exit(1)
146
166
  # ms_ui_env_file(ui_dev_dir)
147
- run_subprocess(['npm', 'start'], cwd=ui_dev_dir)
167
+ run_subprocess(["npm", "start"], cwd=ui_dev_dir)
168
+
148
169
 
149
170
  def main():
150
171
  parser = argparse.ArgumentParser(description="Run the Moonshot application")
151
- parser.add_argument('mode', nargs='?', choices=['web-api', 'cli', 'web', 'help'], help='Mode to run Moonshot in', default=help)
152
- parser.add_argument('cli_command', nargs='?', help='The CLI command to run (e.g., "interactive")')
153
- parser.add_argument('-i', '--install', action='append', choices=['moonshot-data', 'moonshot-ui'], help='Modules to install', default=[])
154
- parser.add_argument('-e', '--env', type=str, help='Path to the .env file', default='.env')
155
-
172
+ parser.add_argument(
173
+ "mode",
174
+ nargs="?",
175
+ choices=["web-api", "cli", "web", "help"],
176
+ help="Mode to run Moonshot in",
177
+ default=help,
178
+ )
179
+ parser.add_argument(
180
+ "cli_command", nargs="?", help='The CLI command to run (e.g., "interactive")'
181
+ )
182
+ parser.add_argument(
183
+ "-i",
184
+ "--install",
185
+ action="append",
186
+ choices=["moonshot-data", "moonshot-ui"],
187
+ help="Modules to install",
188
+ default=[],
189
+ )
190
+ parser.add_argument(
191
+ "-e", "--env", type=str, help="Path to the .env file", default=".env"
192
+ )
193
+
156
194
  args = parser.parse_args()
157
-
195
+
158
196
  # Handle installations based on the -i include arguments
159
- if 'moonshot-data' in args.install:
197
+ if "moonshot-data" in args.install:
160
198
  moonshot_data_installation()
161
199
 
162
- if 'moonshot-ui' in args.install:
200
+ if "moonshot-ui" in args.install:
163
201
  moonshot_ui_installation()
164
202
 
165
203
  # If mode is not specified, skip running any modes
166
204
  if args.mode is None:
167
205
  return
168
-
206
+
169
207
  if args.mode == "help":
170
208
  parser.print_help()
171
209
  sys.exit(1)
@@ -174,18 +212,21 @@ def main():
174
212
 
175
213
  if args.mode == "web-api":
176
214
  from moonshot.integrations.web_api import __main__ as web_api
215
+
177
216
  web_api.start_app()
178
217
  elif args.mode == "web":
179
- # Create and start the UI dev server thread
218
+ # Create and start the UI dev server thread
180
219
  ui_thread = threading.Thread(target=run_moonshot_ui_dev)
181
220
  ui_thread.start()
182
221
  ui_thread.join(timeout=0.1) # Wait briefly for the thread to become alive
183
222
  if not ui_thread.is_alive():
184
223
  sys.exit(1)
185
224
  from moonshot.integrations.web_api import __main__ as web_api
225
+
186
226
  web_api.start_app()
187
227
  elif args.mode == "cli":
188
228
  from moonshot.integrations.cli import __main__ as cli
229
+
189
230
  cli.start_app(args.cli_command)
190
231
 
191
232
  # Handle CLI mode here, possibly also with additional arguments
@@ -194,6 +235,7 @@ def main():
194
235
  parser.print_help()
195
236
  sys.exit(1)
196
237
 
238
+
197
239
  if __name__ == "__main__":
198
240
  warnings.filterwarnings("ignore")
199
- main()
241
+ main()
@@ -29,6 +29,7 @@ from moonshot.src.api.api_dataset import (
29
29
  api_delete_dataset,
30
30
  api_get_all_datasets,
31
31
  api_get_all_datasets_name,
32
+ api_create_datasets
32
33
  )
33
34
  from moonshot.src.api.api_environment_variables import api_set_environment_variables
34
35
  from moonshot.src.api.api_metrics import (
@@ -86,6 +87,14 @@ from moonshot.src.api.api_session import (
86
87
  api_update_prompt_template,
87
88
  api_update_system_prompt,
88
89
  )
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
+ )
89
98
 
90
99
  __all__ = [
91
100
  "api_create_connector_from_endpoint",
@@ -107,6 +116,7 @@ __all__ = [
107
116
  "api_read_cookbook",
108
117
  "api_read_cookbooks",
109
118
  "api_update_cookbook",
119
+ "api_create_datasets",
110
120
  "api_delete_dataset",
111
121
  "api_get_all_datasets",
112
122
  "api_get_all_datasets_name",
@@ -152,4 +162,10 @@ __all__ = [
152
162
  "api_update_metric",
153
163
  "api_update_prompt_template",
154
164
  "api_update_system_prompt",
165
+ "api_get_all_bookmarks",
166
+ "api_get_bookmark",
167
+ "api_insert_bookmark",
168
+ "api_delete_bookmark",
169
+ "api_delete_all_bookmark",
170
+ "api_export_bookmarks",
155
171
  ]