aiverify-moonshot 0.4.2__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 (188) hide show
  1. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/PKG-INFO +2 -2
  2. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/README.md +1 -1
  3. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/api.py +2 -0
  4. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/cookbook.py +36 -28
  5. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/datasets.py +56 -47
  6. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/metrics.py +39 -30
  7. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/recipe.py +63 -73
  8. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/result.py +62 -54
  9. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/run.py +75 -66
  10. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/common.py +8 -0
  11. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/connectors.py +101 -85
  12. aiverify_moonshot-0.4.3/moonshot/integrations/cli/common/dataset.py +66 -0
  13. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/prompt_template.py +30 -27
  14. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/attack_module.py +45 -30
  15. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/context_strategy.py +36 -30
  16. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/session.py +101 -76
  17. aiverify_moonshot-0.4.3/moonshot/integrations/cli/utils/process_data.py +52 -0
  18. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/app.py +1 -1
  19. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/dataset.py +46 -1
  20. aiverify_moonshot-0.4.3/moonshot/integrations/web_api/schemas/dataset_create_dto.py +18 -0
  21. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/recipe_create_dto.py +0 -2
  22. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/bookmark_service.py +6 -2
  23. aiverify_moonshot-0.4.3/moonshot/integrations/web_api/services/dataset_service.py +45 -0
  24. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/recipe_service.py +0 -1
  25. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_dataset.py +35 -0
  26. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_recipe.py +0 -3
  27. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/datasets/dataset.py +116 -0
  28. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/recipes/recipe.py +0 -15
  29. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/recipes/recipe_arguments.py +0 -4
  30. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/utils/log.py +12 -6
  31. aiverify_moonshot-0.4.3/moonshot/src/utils/pagination.py +25 -0
  32. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/pyproject.toml +17 -2
  33. aiverify_moonshot-0.4.2/moonshot/integrations/web_api/services/dataset_service.py +0 -20
  34. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/.coveragerc +0 -0
  35. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/.flake8 +0 -0
  36. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/.github/pull_request_template.md +0 -0
  37. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/.github/workflows/sca_scan.yaml +0 -0
  38. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/.github/workflows/smoke-test.yaml +0 -0
  39. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/.gitignore +0 -0
  40. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/.pre-commit-config.yaml +0 -0
  41. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/AUTHORS.md +0 -0
  42. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/LICENSE.md +0 -0
  43. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/NOTICES.md +0 -0
  44. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/__init__.py +0 -0
  45. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/__main__.py +0 -0
  46. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/__init__.py +0 -0
  47. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/__init__.py +0 -0
  48. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/__main__.py +0 -0
  49. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/active_session_cfg.py +0 -0
  50. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/__init__.py +0 -0
  51. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/benchmark.py +0 -0
  52. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/benchmark/runner.py +0 -0
  53. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/cli.py +0 -0
  54. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/__init__.py +0 -0
  55. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/common/display_helper.py +0 -0
  56. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/initialisation/__init__.py +0 -0
  57. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/initialisation/initialisation.py +0 -0
  58. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/__init__.py +0 -0
  59. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/prompt_template.py +0 -0
  60. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/cli/redteam/redteam.py +0 -0
  61. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/.env.dev +0 -0
  62. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/__init__.py +0 -0
  63. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/__main__.py +0 -0
  64. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/container.py +0 -0
  65. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/log/.gitkeep +0 -0
  66. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/logging_conf.py +0 -0
  67. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/__init__.py +0 -0
  68. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/attack_modules.py +0 -0
  69. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/benchmark.py +0 -0
  70. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/benchmark_result.py +0 -0
  71. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/bookmark.py +0 -0
  72. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/context_strategy.py +0 -0
  73. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/cookbook.py +0 -0
  74. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/endpoint.py +0 -0
  75. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/metric.py +0 -0
  76. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/prompt_template.py +0 -0
  77. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/recipe.py +0 -0
  78. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/redteam.py +0 -0
  79. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/routes/runner.py +0 -0
  80. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/__init__.py +0 -0
  81. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/benchmark_runner_dto.py +0 -0
  82. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/bookmark_create_dto.py +0 -0
  83. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/cookbook_create_dto.py +0 -0
  84. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/cookbook_response_model.py +0 -0
  85. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/dataset_response_dto.py +0 -0
  86. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/endpoint_create_dto.py +0 -0
  87. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/endpoint_response_model.py +0 -0
  88. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/prompt_response_model.py +0 -0
  89. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/prompt_template_response_model.py +0 -0
  90. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/recipe_response_model.py +0 -0
  91. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/session_create_dto.py +0 -0
  92. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/session_prompt_dto.py +0 -0
  93. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/schemas/session_response_model.py +0 -0
  94. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/__init__.py +0 -0
  95. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/attack_module_service.py +0 -0
  96. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/auto_red_team_test_manager.py +0 -0
  97. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/auto_red_team_test_state.py +0 -0
  98. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/base_service.py +0 -0
  99. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/benchmark_result_service.py +0 -0
  100. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/benchmark_test_manager.py +0 -0
  101. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/benchmark_test_state.py +0 -0
  102. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/benchmarking_service.py +0 -0
  103. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/context_strategy_service.py +0 -0
  104. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/cookbook_service.py +0 -0
  105. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/endpoint_service.py +0 -0
  106. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/metric_service.py +0 -0
  107. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/prompt_template_service.py +0 -0
  108. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/runner_service.py +0 -0
  109. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/session_service.py +0 -0
  110. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/utils/exceptions_handler.py +0 -0
  111. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/utils/file_manager.py +0 -0
  112. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/services/utils/results_formatter.py +0 -0
  113. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/status_updater/interface/benchmark_progress_callback.py +0 -0
  114. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/status_updater/interface/redteam_progress_callback.py +0 -0
  115. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/status_updater/moonshot_ui_webhook.py +0 -0
  116. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/temp/.gitkeep +0 -0
  117. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/integrations/web_api/types/types.py +0 -0
  118. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/__init__.py +0 -0
  119. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/__init__.py +0 -0
  120. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_bookmark.py +0 -0
  121. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_connector.py +0 -0
  122. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_connector_endpoint.py +0 -0
  123. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_context_strategy.py +0 -0
  124. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_cookbook.py +0 -0
  125. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_environment_variables.py +0 -0
  126. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_metrics.py +0 -0
  127. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_prompt_template.py +0 -0
  128. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_red_teaming.py +0 -0
  129. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_result.py +0 -0
  130. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_run.py +0 -0
  131. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_runner.py +0 -0
  132. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/api/api_session.py +0 -0
  133. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/bookmark/bookmark.py +0 -0
  134. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/bookmark/bookmark_arguments.py +0 -0
  135. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/configs/__init__.py +0 -0
  136. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/configs/env_variables.py +0 -0
  137. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/connectors/__init__.py +0 -0
  138. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/connectors/connector.py +0 -0
  139. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/connectors/connector_prompt_arguments.py +0 -0
  140. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/connectors_endpoints/__init__.py +0 -0
  141. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/connectors_endpoints/connector_endpoint.py +0 -0
  142. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/connectors_endpoints/connector_endpoint_arguments.py +0 -0
  143. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/cookbooks/__init__.py +0 -0
  144. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/cookbooks/cookbook.py +0 -0
  145. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/cookbooks/cookbook_arguments.py +0 -0
  146. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/datasets/__init__.py +0 -0
  147. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/datasets/dataset_arguments.py +0 -0
  148. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/metrics/__init__.py +0 -0
  149. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/metrics/metric.py +0 -0
  150. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/metrics/metric_interface.py +0 -0
  151. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/prompt_templates/__init__.py +0 -0
  152. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/prompt_templates/prompt_template.py +0 -0
  153. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/recipes/__init__.py +0 -0
  154. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/__init__.py +0 -0
  155. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/attack/__init__.py +0 -0
  156. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/attack/attack_module.py +0 -0
  157. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/attack/attack_module_arguments.py +0 -0
  158. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/attack/context_strategy.py +0 -0
  159. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/context_strategy/__init__.py +0 -0
  160. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/context_strategy/context_strategy_interface.py +0 -0
  161. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/session/__init__.py +0 -0
  162. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/session/chat.py +0 -0
  163. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/session/red_teaming_progress.py +0 -0
  164. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/session/red_teaming_type.py +0 -0
  165. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/redteaming/session/session.py +0 -0
  166. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/results/__init__.py +0 -0
  167. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/results/result.py +0 -0
  168. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/results/result_arguments.py +0 -0
  169. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/runners/__init__.py +0 -0
  170. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/runners/runner.py +0 -0
  171. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/runners/runner_arguments.py +0 -0
  172. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/runners/runner_type.py +0 -0
  173. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/runs/__init__.py +0 -0
  174. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/runs/run.py +0 -0
  175. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/runs/run_arguments.py +0 -0
  176. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/runs/run_progress.py +0 -0
  177. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/runs/run_status.py +0 -0
  178. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/storage/__init__.py +0 -0
  179. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/storage/db_interface.py +0 -0
  180. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/storage/io_interface.py +0 -0
  181. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/storage/storage.py +0 -0
  182. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/utils/__init__.py +0 -0
  183. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/utils/find_feature.py +0 -0
  184. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/utils/import_modules.py +0 -0
  185. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/moonshot/src/utils/timeit.py +0 -0
  186. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/requirements.txt +0 -0
  187. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/third-party/pygments-2.18.0-py3-none-any.whl +0 -0
  188. {aiverify_moonshot-0.4.2 → aiverify_moonshot-0.4.3}/third-party/text_unidecode-1.3-py2.py3-none-any.whl +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aiverify-moonshot
3
- Version: 0.4.2
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.2**
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.2**
5
+ **Version 0.4.3**
6
6
 
7
7
  A simple and modular tool to evaluate any LLM application.
8
8
 
@@ -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 (
@@ -115,6 +116,7 @@ __all__ = [
115
116
  "api_read_cookbook",
116
117
  "api_read_cookbooks",
117
118
  "api_update_cookbook",
119
+ "api_create_datasets",
118
120
  "api_delete_dataset",
119
121
  "api_get_all_datasets",
120
122
  "api_get_all_datasets_name",
@@ -23,7 +23,7 @@ from moonshot.integrations.cli.benchmark.recipe import (
23
23
  display_view_statistics_format,
24
24
  )
25
25
  from moonshot.integrations.cli.common.display_helper import display_view_list_format
26
- from moonshot.src.utils.find_feature import find_keyword
26
+ from moonshot.integrations.cli.utils.process_data import filter_data
27
27
 
28
28
  console = Console()
29
29
 
@@ -62,29 +62,31 @@ def list_cookbooks(args) -> list | None:
62
62
 
63
63
  This function retrieves all available cookbooks by calling the api_get_all_cookbook function from the
64
64
  moonshot.api module.
65
- It then displays the retrieved cookbooks using the display_cookbooks function.
65
+ It then displays the retrieved cookbooks using the _display_cookbooks function.
66
66
 
67
67
  Args:
68
68
  args: A namespace object from argparse. It should have an optional attribute:
69
69
  find (str): Optional field to find cookbook(s) with a keyword.
70
+ pagination (str): Optional field to paginate cookbooks.
70
71
 
71
72
  Returns:
72
73
  list | None: A list of Cookbook or None if there is no result.
73
74
  """
75
+
74
76
  try:
75
77
  cookbooks_list = api_get_all_cookbook()
76
78
  keyword = args.find.lower() if args.find else ""
77
- if keyword:
78
- filtered_cookbooks_list = find_keyword(keyword, cookbooks_list)
79
+ pagination = literal_eval(args.pagination) if args.pagination else ()
80
+
81
+ if cookbooks_list:
82
+ filtered_cookbooks_list = filter_data(cookbooks_list, keyword, pagination)
79
83
  if filtered_cookbooks_list:
80
- display_cookbooks(filtered_cookbooks_list)
84
+ _display_cookbooks(filtered_cookbooks_list)
81
85
  return filtered_cookbooks_list
82
- else:
83
- print("No cookbooks containing keyword found.")
84
- return None
85
- else:
86
- display_cookbooks(cookbooks_list)
87
- return cookbooks_list
86
+
87
+ console.print("[red]There are no cookbooks found.[/red]")
88
+ return None
89
+
88
90
  except Exception as e:
89
91
  print(f"[list_cookbooks]: {str(e)}")
90
92
 
@@ -236,7 +238,7 @@ def delete_cookbook(args) -> None:
236
238
  # ------------------------------------------------------------------------------
237
239
  # Helper functions: Display on cli
238
240
  # ------------------------------------------------------------------------------
239
- def display_cookbooks(cookbooks_list):
241
+ def _display_cookbooks(cookbooks_list):
240
242
  """
241
243
  Display the list of cookbooks in a tabular format.
242
244
 
@@ -247,22 +249,20 @@ def display_cookbooks(cookbooks_list):
247
249
  Args:
248
250
  cookbooks_list (list): A list of dictionaries, where each dictionary contains the details of a cookbook.
249
251
  """
250
- if cookbooks_list:
251
- table = Table(
252
- title="List of Cookbooks", show_lines=True, expand=True, header_style="bold"
253
- )
254
- table.add_column("No.", width=2)
255
- table.add_column("Cookbook", justify="left", width=78)
256
- table.add_column("Contains", justify="left", width=20, overflow="fold")
257
- for cookbook_id, cookbook in enumerate(cookbooks_list, 1):
258
- id, name, description, recipes = cookbook.values()
259
- cookbook_info = f"[red]ID: {id}[/red]\n\n[blue]{name}[/blue]\n{description}"
260
- recipes_info = display_view_list_format("Recipes", recipes)
261
- table.add_section()
262
- table.add_row(str(cookbook_id), cookbook_info, recipes_info)
263
- console.print(table)
264
- else:
265
- console.print("[red]There are no cookbooks found.[/red]")
252
+ table = Table(
253
+ title="List of Cookbooks", show_lines=True, expand=True, header_style="bold"
254
+ )
255
+ table.add_column("No.", width=2)
256
+ table.add_column("Cookbook", justify="left", width=78)
257
+ table.add_column("Contains", justify="left", width=20, overflow="fold")
258
+ for idx, cookbook in enumerate(cookbooks_list, 1):
259
+ id, name, description, recipes, *other_args = cookbook.values()
260
+ idx = cookbook.get("idx", idx)
261
+ cookbook_info = f"[red]ID: {id}[/red]\n\n[blue]{name}[/blue]\n{description}"
262
+ recipes_info = display_view_list_format("Recipes", recipes)
263
+ table.add_section()
264
+ table.add_row(str(idx), cookbook_info, recipes_info)
265
+ console.print(table)
266
266
 
267
267
 
268
268
  def display_view_cookbook(cookbook_info):
@@ -573,3 +573,11 @@ list_cookbooks_args.add_argument(
573
573
  help="Optional field to find cookbook(s) with keyword",
574
574
  nargs="?",
575
575
  )
576
+
577
+ list_cookbooks_args.add_argument(
578
+ "-p",
579
+ "--pagination",
580
+ type=str,
581
+ help="Optional tuple to paginate cookbook(s). E.g. (2,10) returns 2nd page with 10 items in each page.",
582
+ nargs="?",
583
+ )
@@ -1,3 +1,5 @@
1
+ from ast import literal_eval
2
+
1
3
  import cmd2
2
4
  from rich.console import Console
3
5
  from rich.table import Table
@@ -8,7 +10,7 @@ from moonshot.api import (
8
10
  api_get_all_datasets_name,
9
11
  )
10
12
  from moonshot.integrations.cli.common.display_helper import display_view_str_format
11
- from moonshot.src.utils.find_feature import find_keyword
13
+ from moonshot.integrations.cli.utils.process_data import filter_data
12
14
 
13
15
  console = Console()
14
16
 
@@ -21,12 +23,13 @@ def list_datasets(args) -> list | None:
21
23
  List all available datasets.
22
24
 
23
25
  This function retrieves all available datasets by calling the api_get_all_datasets function from the
24
- moonshot.api module. It then displays the datasets using the display_datasets function. If an exception occurs,
26
+ moonshot.api module. It then displays the datasets using the _display_datasets function. If an exception occurs,
25
27
  it prints an error message.
26
28
 
27
29
  Args:
28
30
  args: A namespace object from argparse. It should have an optional attribute:
29
31
  find (str): Optional field to find dataset(s) with a keyword.
32
+ pagination (str): Optional field to paginate datasets.
30
33
 
31
34
  Returns:
32
35
  list | None: A list of Dataset or None if there is no result.
@@ -35,17 +38,16 @@ def list_datasets(args) -> list | None:
35
38
  print("Listing datasets may take a while...")
36
39
  datasets_list = api_get_all_datasets()
37
40
  keyword = args.find.lower() if args.find else ""
38
- if keyword:
39
- filtered_datasets_list = find_keyword(keyword, datasets_list)
41
+ pagination = literal_eval(args.pagination) if args.pagination else ()
42
+
43
+ if datasets_list:
44
+ filtered_datasets_list = filter_data(datasets_list, keyword, pagination)
40
45
  if filtered_datasets_list:
41
- display_datasets(filtered_datasets_list)
46
+ _display_datasets(filtered_datasets_list)
42
47
  return filtered_datasets_list
43
- else:
44
- print("No datasets containing keyword found.")
45
- return None
46
- else:
47
- display_datasets(datasets_list)
48
- return datasets_list
48
+
49
+ console.print("[red]There are no datasets found.[/red]")
50
+ return None
49
51
  except Exception as e:
50
52
  print(f"[list_datasets]: {str(e)}")
51
53
 
@@ -56,7 +58,7 @@ def view_dataset(args) -> None:
56
58
 
57
59
  This function retrieves all available datasets and their names by calling the api_get_all_datasets and
58
60
  api_get_all_datasets_name functions. It then finds the dataset with the name specified in args.dataset_filename
59
- and displays it using the display_datasets function. If an exception occurs, it prints an error message.
61
+ and displays it using the _display_datasets function. If an exception occurs, it prints an error message.
60
62
 
61
63
  Args:
62
64
  args: A namespace object from argparse. It should have the following attribute:
@@ -72,8 +74,8 @@ def view_dataset(args) -> None:
72
74
 
73
75
  # Find the index of the dataset with the name args.dataset_filename
74
76
  dataset_index = datasets_name_list.index(args.dataset_filename)
75
- # Pass the corresponding dataset from datasets_list to display_datasets
76
- display_datasets([datasets_list[dataset_index]])
77
+ # Pass the corresponding dataset from datasets_list to _display_datasets
78
+ _display_datasets([datasets_list[dataset_index]])
77
79
 
78
80
  except Exception as e:
79
81
  print(f"[view_dataset]: {str(e)}")
@@ -112,7 +114,7 @@ def delete_dataset(args) -> None:
112
114
  # ------------------------------------------------------------------------------
113
115
  # Helper functions: Display on cli
114
116
  # ------------------------------------------------------------------------------
115
- def display_datasets(datasets_list: list):
117
+ def _display_datasets(datasets_list: list):
116
118
  """
117
119
  Displays a list of datasets in a table format.
118
120
 
@@ -125,39 +127,38 @@ def display_datasets(datasets_list: list):
125
127
  Returns:
126
128
  None
127
129
  """
128
- if datasets_list:
129
- table = Table(
130
- title="List of Datasets", show_lines=True, expand=True, header_style="bold"
130
+ table = Table(
131
+ title="List of Datasets", show_lines=True, expand=True, header_style="bold"
132
+ )
133
+ table.add_column("No.", width=2)
134
+ table.add_column("Dataset", justify="left", width=78)
135
+ for idx, dataset in enumerate(datasets_list, 1):
136
+ (
137
+ id,
138
+ name,
139
+ description,
140
+ _,
141
+ num_of_dataset_prompts,
142
+ created_date,
143
+ reference,
144
+ license,
145
+ *other_args,
146
+ ) = dataset.values()
147
+
148
+ idx = dataset.get("idx", idx)
149
+ prompt_info = display_view_str_format("Prompts", num_of_dataset_prompts)
150
+ created_date_info = display_view_str_format("Created Date", created_date)
151
+ license_info = display_view_str_format("License", license)
152
+ reference_info = display_view_str_format("Reference", reference)
153
+
154
+ dataset_info = (
155
+ f"[red]{id}[/red]\n\n[blue]{name}[/blue]\n{description}\n\n"
156
+ f"{prompt_info}\n\n{created_date_info}\n\n{license_info}\n\n{reference_info}"
131
157
  )
132
- table.add_column("No.", width=2)
133
- table.add_column("Dataset", justify="left", width=78)
134
- for dataset_no, dataset in enumerate(datasets_list, 1):
135
- (
136
- id,
137
- name,
138
- description,
139
- _,
140
- num_of_dataset_prompts,
141
- created_date,
142
- reference,
143
- license,
144
- ) = dataset.values()
145
-
146
- prompt_info = display_view_str_format("Prompts", num_of_dataset_prompts)
147
- created_date_info = display_view_str_format("Created Date", created_date)
148
- license_info = display_view_str_format("License", license)
149
- reference_info = display_view_str_format("Reference", reference)
150
-
151
- dataset_info = (
152
- f"[red]{id}[/red]\n\n[blue]{name}[/blue]\n{description}\n\n"
153
- f"{prompt_info}\n\n{created_date_info}\n\n{license_info}\n\n{reference_info}"
154
- )
155
-
156
- table.add_section()
157
- table.add_row(str(dataset_no), dataset_info)
158
- console.print(table)
159
- else:
160
- console.print("[red]There are no datasets found.[/red]")
158
+
159
+ table.add_section()
160
+ table.add_row(str(idx), dataset_info)
161
+ console.print(table)
161
162
 
162
163
 
163
164
  # ------------------------------------------------------------------------------
@@ -192,3 +193,11 @@ list_datasets_args.add_argument(
192
193
  help="Optional field to find dataset(s) with keyword",
193
194
  nargs="?",
194
195
  )
196
+
197
+ list_datasets_args.add_argument(
198
+ "-p",
199
+ "--pagination",
200
+ type=str,
201
+ help="Optional tuple to paginate dataset(s). E.g. (2,10) returns 2nd page with 10 items in each page.",
202
+ nargs="?",
203
+ )
@@ -1,9 +1,11 @@
1
+ from ast import literal_eval
2
+
1
3
  import cmd2
2
4
  from rich.console import Console
3
5
  from rich.table import Table
4
6
 
5
7
  from moonshot.api import api_delete_metric, api_get_all_metric, api_get_all_metric_name
6
- from moonshot.src.utils.find_feature import find_keyword
8
+ from moonshot.integrations.cli.utils.process_data import filter_data
7
9
 
8
10
  console = Console()
9
11
 
@@ -16,31 +18,32 @@ def list_metrics(args) -> list | None:
16
18
  List all available metrics.
17
19
 
18
20
  This function retrieves all available metrics by calling the api_get_all_metric function from the
19
- moonshot.api module. It then displays the metrics using the display_metrics function. If an exception occurs,
21
+ moonshot.api module. It then displays the metrics using the _display_metrics function. If an exception occurs,
20
22
  it prints an error message.
21
23
 
22
24
  Args:
23
25
  args: A namespace object from argparse. It should have an optional attribute:
24
26
  find (str): Optional field to find metric(s) with a keyword.
27
+ pagination (str): Optional field to paginate metrics.
25
28
 
26
29
  Returns:
27
30
  list | None: A list of Metric or None if there is no result.
28
31
  """
32
+
29
33
  try:
30
34
  print("Listing metrics may take a while...")
31
35
  metrics_list = api_get_all_metric()
32
36
  keyword = args.find.lower() if args.find else ""
33
- if keyword:
34
- filtered_metrics_list = find_keyword(keyword, metrics_list)
37
+ pagination = literal_eval(args.pagination) if args.pagination else ()
38
+
39
+ if metrics_list:
40
+ filtered_metrics_list = filter_data(metrics_list, keyword, pagination)
35
41
  if filtered_metrics_list:
36
- display_metrics(filtered_metrics_list)
42
+ _display_metrics(filtered_metrics_list)
37
43
  return filtered_metrics_list
38
- else:
39
- print("No metrics containing keyword found.")
40
- return None
41
- else:
42
- display_metrics(metrics_list)
43
- return metrics_list
44
+
45
+ console.print("[red]There are no metrics found.[/red]")
46
+ return None
44
47
  except Exception as e:
45
48
  print(f"[list_metrics]: {str(e)}")
46
49
 
@@ -51,7 +54,7 @@ def view_metric(args) -> None:
51
54
 
52
55
  This function retrieves all available metrics and their names by calling the api_get_all_metric and
53
56
  api_get_all_metric_name functions. It then finds the metric with the name specified in args.metric_filename
54
- and displays it using the display_metrics function. If an exception occurs, it prints an error message.
57
+ and displays it using the _display_metrics function. If an exception occurs, it prints an error message.
55
58
 
56
59
  Args:
57
60
  args: A namespace object from argparse. It should have the following attribute:
@@ -67,8 +70,8 @@ def view_metric(args) -> None:
67
70
 
68
71
  # Find the index of the metric with the name args.metric_filename
69
72
  metric_index = metrics_name_list.index(args.metric_filename)
70
- # Pass the corresponding metric from metrics_list to display_metrics
71
- display_metrics([metrics_list[metric_index]])
73
+ # Pass the corresponding metric from metrics_list to _display_metrics
74
+ _display_metrics([metrics_list[metric_index]])
72
75
 
73
76
  except Exception as e:
74
77
  print(f"[view_metric]: {str(e)}")
@@ -107,7 +110,7 @@ def delete_metric(args) -> None:
107
110
  # ------------------------------------------------------------------------------
108
111
  # Helper functions: Display on cli
109
112
  # ------------------------------------------------------------------------------
110
- def display_metrics(metrics_list: list):
113
+ def _display_metrics(metrics_list: list):
111
114
  """
112
115
  Displays a list of metrics in a table format.
113
116
 
@@ -120,21 +123,19 @@ def display_metrics(metrics_list: list):
120
123
  Returns:
121
124
  None
122
125
  """
123
- if metrics_list:
124
- table = Table(
125
- title="List of Metrics", show_lines=True, expand=True, header_style="bold"
126
- )
127
- table.add_column("No.", width=2)
128
- table.add_column("Metric", justify="left", width=78)
129
- for metric_no, metric in enumerate(metrics_list, 1):
130
- id, name, description = metric.values()
131
- result_info = f"[red]id: {id}[/red]\n\n[blue]{name}[/blue]\n{description}"
132
-
133
- table.add_section()
134
- table.add_row(str(metric_no), result_info)
135
- console.print(table)
136
- else:
137
- console.print("[red]There are no metrics found.[/red]")
126
+ table = Table(
127
+ title="List of Metrics", show_lines=True, expand=True, header_style="bold"
128
+ )
129
+ table.add_column("No.", width=2)
130
+ table.add_column("Metric", justify="left", width=78)
131
+ for idx, metric in enumerate(metrics_list, 1):
132
+ id, name, description, *other_args = metric.values()
133
+ idx = metric.get("idx", idx)
134
+ result_info = f"[red]id: {id}[/red]\n\n[blue]{name}[/blue]\n{description}"
135
+
136
+ table.add_section()
137
+ table.add_row(str(idx), result_info)
138
+ console.print(table)
138
139
 
139
140
 
140
141
  # ------------------------------------------------------------------------------
@@ -169,3 +170,11 @@ list_metrics_args.add_argument(
169
170
  help="Optional field to find metric(s) with keyword",
170
171
  nargs="?",
171
172
  )
173
+
174
+ list_metrics_args.add_argument(
175
+ "-p",
176
+ "--pagination",
177
+ type=str,
178
+ help="Optional tuple to paginate metric(s). E.g. (2,10) returns 2nd page with 10 items in each page.",
179
+ nargs="?",
180
+ )