aiverify-moonshot 0.4.8__py3-none-any.whl → 0.4.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {aiverify_moonshot-0.4.8.dist-info → aiverify_moonshot-0.4.9.dist-info}/METADATA +3 -3
  2. {aiverify_moonshot-0.4.8.dist-info → aiverify_moonshot-0.4.9.dist-info}/RECORD +29 -29
  3. {aiverify_moonshot-0.4.8.dist-info → aiverify_moonshot-0.4.9.dist-info}/licenses/LICENSE.md +1 -1
  4. moonshot/__main__.py +93 -49
  5. moonshot/api.py +12 -10
  6. moonshot/integrations/cli/benchmark/metrics.py +8 -2
  7. moonshot/integrations/cli/cli_errors.py +14 -0
  8. moonshot/integrations/cli/common/common.py +14 -8
  9. moonshot/integrations/cli/common/dataset.py +303 -65
  10. moonshot/integrations/cli/redteam/attack_module.py +30 -1
  11. moonshot/integrations/web_api/app.py +1 -1
  12. moonshot/integrations/web_api/routes/dataset.py +52 -18
  13. moonshot/integrations/web_api/schemas/cookbook_response_model.py +2 -0
  14. moonshot/integrations/web_api/schemas/dataset_create_dto.py +14 -4
  15. moonshot/integrations/web_api/schemas/recipe_response_model.py +1 -0
  16. moonshot/integrations/web_api/services/cookbook_service.py +36 -9
  17. moonshot/integrations/web_api/services/dataset_service.py +34 -9
  18. moonshot/integrations/web_api/services/recipe_service.py +33 -3
  19. moonshot/src/api/api_dataset.py +43 -11
  20. moonshot/src/bookmark/bookmark.py +16 -9
  21. moonshot/src/datasets/dataset.py +37 -45
  22. moonshot/src/datasets/dataset_arguments.py +2 -1
  23. moonshot/src/messages_constants.py +1 -0
  24. moonshot/src/redteaming/attack/attack_module.py +40 -0
  25. moonshot/src/storage/io_interface.py +18 -1
  26. moonshot/src/storage/storage.py +57 -1
  27. {aiverify_moonshot-0.4.8.dist-info → aiverify_moonshot-0.4.9.dist-info}/WHEEL +0 -0
  28. {aiverify_moonshot-0.4.8.dist-info → aiverify_moonshot-0.4.9.dist-info}/licenses/AUTHORS.md +0 -0
  29. {aiverify_moonshot-0.4.8.dist-info → aiverify_moonshot-0.4.9.dist-info}/licenses/NOTICES.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aiverify-moonshot
3
- Version: 0.4.8
3
+ Version: 0.4.9
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
  ![Moonshot Logo](https://github.com/aiverify-foundation/moonshot/raw/main/misc/aiverify-moonshot-logo.png)
48
48
 
49
- **Version 0.4.8**
49
+ **Version 0.4.9**
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/common_issues/).
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:
@@ -1,31 +1,31 @@
1
1
  moonshot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- moonshot/__main__.py,sha256=owir7ug4VzfPwG7hSYTrN03SRpHMiLUifoEe_-IaeYw,9908
3
- moonshot/api.py,sha256=f7vIMlpC-1ZQsbqipe2cTlP5dwgoVujQKYNxzEKcWlg,4822
2
+ moonshot/__main__.py,sha256=1lpqD3azEnA0wMwIJ0K6cJd5sQFl-v3M8M0ehr-wrAU,11801
3
+ moonshot/api.py,sha256=wvad-BcKDKEu25c6-YrsBx_uPiLKIBRsbwgThT50Uh0,4877
4
4
  moonshot/integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  moonshot/integrations/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  moonshot/integrations/cli/__main__.py,sha256=0VnYSj2AayvDCZ3uXpldPcjMHt2Yd7BWojWzFOGSSl4,679
7
7
  moonshot/integrations/cli/active_session_cfg.py,sha256=n8hOFxFjvz26qbEFY4q7iPUZYrGLoeCmXJxmOb_xWUE,20
8
8
  moonshot/integrations/cli/cli.py,sha256=9tnzcxcSOjblxCUpyh3pK0ke0bLs3s-63OxXtYoZI2g,2769
9
- moonshot/integrations/cli/cli_errors.py,sha256=vH7oUBjTD7pLqG7jwKv4bsKhvsSb6_3WSRbaeWWc4oI,22981
9
+ moonshot/integrations/cli/cli_errors.py,sha256=wDwBtxZcHPWIJa6ZVW0MoWm81aeqmhYhi7SLI7TQ4_4,23565
10
10
  moonshot/integrations/cli/benchmark/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  moonshot/integrations/cli/benchmark/benchmark.py,sha256=QUxr6DU11-XeH6Y3j1uPsZsotshgy64G_cWNf0Rn2_U,6303
12
12
  moonshot/integrations/cli/benchmark/cookbook.py,sha256=h9exPhLKLRa9a1qWB2WptZ35gcVov332tjHDO9ECs0o,29639
13
13
  moonshot/integrations/cli/benchmark/datasets.py,sha256=Uq5XMNWUp775sz9jCZUZHHmkumPFI7cHVRueHgWm70Q,8965
14
- moonshot/integrations/cli/benchmark/metrics.py,sha256=ATZtVOj3kjGuyxOgfAO1QzTDeAOEjbSeQYr3NOCmTCQ,8070
14
+ moonshot/integrations/cli/benchmark/metrics.py,sha256=SHs-hIa4CIPyOJtxK2U4D6IRHy3ZNsRtZlAMGvF9Qxw,8310
15
15
  moonshot/integrations/cli/benchmark/recipe.py,sha256=yVFX3pwNzDL0a95rjlQd4cek06M9blv5jIeYB26jOKk,32481
16
16
  moonshot/integrations/cli/benchmark/result.py,sha256=TGlIuDkPB1Cfu1u2uyDsWtgQxTOoNdGDzc0vCnGC1zk,11152
17
17
  moonshot/integrations/cli/benchmark/run.py,sha256=HBztvG_Zkg1ZAWsFv0QDE43FaEmx92vTWc4h1U3VesU,7438
18
18
  moonshot/integrations/cli/benchmark/runner.py,sha256=Y4Vt6Qqn9QzsM6eLUM9m2_XKkW3ctu-2jMTSei_TDPU,7098
19
19
  moonshot/integrations/cli/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
- moonshot/integrations/cli/common/common.py,sha256=hSvxj-T91nhKfJtQqxrIPgYdS8P_g7wbOwpFpqBg90I,3090
20
+ moonshot/integrations/cli/common/common.py,sha256=RjlIqV82DHVi5CeUjOkC1xYlVAq4mxelDD9MN4Tj4jU,3302
21
21
  moonshot/integrations/cli/common/connectors.py,sha256=7fcmzNU8iPodc8SPhO8kEn0fMrS8voCvy12QBm8PP00,19477
22
- moonshot/integrations/cli/common/dataset.py,sha256=6v5qXgWBGhT4Rl5uuqPMwLeFF0c5m7ECzyGe1IFXNW0,4743
22
+ moonshot/integrations/cli/common/dataset.py,sha256=zkVGtIJIozJPPs_Qc__Hnw1tAh_pcvYV5gqf_eOaGXQ,12749
23
23
  moonshot/integrations/cli/common/display_helper.py,sha256=8rVowW33XK0j0C_X_H1jUbFlFk1Y2WpzxmIUE3Ca5Co,1459
24
24
  moonshot/integrations/cli/common/prompt_template.py,sha256=2cXWeHh16EUvzYFre7juMxT2R0x3kqDJVucH0bKLmCU,6351
25
25
  moonshot/integrations/cli/initialisation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  moonshot/integrations/cli/initialisation/initialisation.py,sha256=zMjklhoBlYLPshe7Q16vBBbOfhbPjZc4_ooywAFp2XY,387
27
27
  moonshot/integrations/cli/redteam/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- moonshot/integrations/cli/redteam/attack_module.py,sha256=sjjQdBno7rXNfrXqns55ERSfD0ZFE0CQoWOk-sTJcqo,4599
28
+ moonshot/integrations/cli/redteam/attack_module.py,sha256=d3UCtt8IdVhTMOMpvJG4sfhX6E7bdxCprrgAN83_vas,5886
29
29
  moonshot/integrations/cli/redteam/context_strategy.py,sha256=gLNgnd1oHWD1X93BQoKlR7G8b5g9P6AcKFLlE3WvETk,7065
30
30
  moonshot/integrations/cli/redteam/prompt_template.py,sha256=rWINvMFLax8ynIFJoX93xsB1cWJ8-dQ1nRyqgdri2yQ,2079
31
31
  moonshot/integrations/cli/redteam/redteam.py,sha256=144tVuiSWBLseC0EvvIuevHYJhqn39xvg36-1cLgGWQ,4257
@@ -34,7 +34,7 @@ moonshot/integrations/cli/utils/process_data.py,sha256=QVL5vp2_8ZgGicmCAdeYEHkeb
34
34
  moonshot/integrations/web_api/.env.dev,sha256=0z5_Ut8rF-UqFZtgjkH2qoqORhD5_nSs2w_OeX2SteI,182
35
35
  moonshot/integrations/web_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  moonshot/integrations/web_api/__main__.py,sha256=MdnLi_ZF-olAAEJwTPU1iGYFYwo-fNWNT2qfchkH3y4,2050
37
- moonshot/integrations/web_api/app.py,sha256=pTRq76B_FoSOPxuLKqCesFz21_c-82vebybO1oFcnNs,3651
37
+ moonshot/integrations/web_api/app.py,sha256=IucbtkC1n2l0Mx55St0e7FFWa_hV7Mdg64Sv9AZ41Ro,3651
38
38
  moonshot/integrations/web_api/container.py,sha256=DVkJG_qm7ItcG6tgMYOqIj07wpKhPWOOfy6-bEv72y4,5915
39
39
  moonshot/integrations/web_api/logging_conf.py,sha256=t3EGRV6tZhV732KXe8_Tiy0fiwVAWxZX5Tt8VTgrrfg,3388
40
40
  moonshot/integrations/web_api/log/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -45,7 +45,7 @@ moonshot/integrations/web_api/routes/benchmark_result.py,sha256=WZ_dI8qT4dli9hKP
45
45
  moonshot/integrations/web_api/routes/bookmark.py,sha256=aHUT86Llbzqo1CT3Dy7ciIhxVEzu1YgZk_VkxVeOZ3s,6304
46
46
  moonshot/integrations/web_api/routes/context_strategy.py,sha256=kJTpjrwxfYGyBLY_hAgpHOMZMtjV5Z6vpu7RIdHDylg,4828
47
47
  moonshot/integrations/web_api/routes/cookbook.py,sha256=oddmcdfhgH3qZb4_ThfUk8SBKmHOt51dFlAHubQh2fQ,8648
48
- moonshot/integrations/web_api/routes/dataset.py,sha256=qtxflHRDr31W3u6voOFE5iRHsCVr0MQ35H94Pw5M1YU,6114
48
+ moonshot/integrations/web_api/routes/dataset.py,sha256=9o8K81xn-fKappgPU4pcRSnLUl2J79MyR5PZijY5ueI,7312
49
49
  moonshot/integrations/web_api/routes/endpoint.py,sha256=ZFx0WUe3-GGdmBz_hzYiOmjvJHN4PQy_8lCKJMBjxcE,10715
50
50
  moonshot/integrations/web_api/routes/metric.py,sha256=f_HHexxKUfqFE5FkeCwRh8n36H2mREtLnK2pDrw3A-w,2856
51
51
  moonshot/integrations/web_api/routes/prompt_template.py,sha256=M3adeNeWvLQJJlFQ0uZqSXEuNpTcagApnuqWvLiL1mg,4890
@@ -56,15 +56,15 @@ moonshot/integrations/web_api/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCe
56
56
  moonshot/integrations/web_api/schemas/benchmark_runner_dto.py,sha256=nfNMt_9Xg0YAL5f93dZamu7DxSLvAsz8-tdA_DTCXQQ,322
57
57
  moonshot/integrations/web_api/schemas/bookmark_create_dto.py,sha256=C78vG8UG02N7Cmt6RSuS8e4sX_G-MLCiAWT-cF5BE8s,374
58
58
  moonshot/integrations/web_api/schemas/cookbook_create_dto.py,sha256=00SPVw7lEpfY9yOFdt1XkvvNAzfFRd7d7CA90qguhuQ,670
59
- moonshot/integrations/web_api/schemas/cookbook_response_model.py,sha256=eJtAi5cbGfSqP57qyzyeLqffPIrpM5lutqpW7_H0xLY,240
60
- moonshot/integrations/web_api/schemas/dataset_create_dto.py,sha256=U4D_pmybKNVfdlFuOPC-tew8qs0FEz6z3dDlwY4NJW0,482
59
+ moonshot/integrations/web_api/schemas/cookbook_response_model.py,sha256=J_DkyuWwNNy6_G1QT6JY-qIr0zhMkQd208wXhTA-Tao,342
60
+ moonshot/integrations/web_api/schemas/dataset_create_dto.py,sha256=Jr_EbIgqR7K__LQXpXSocfYLE6oN7pGRFzWcDVcFaus,963
61
61
  moonshot/integrations/web_api/schemas/dataset_response_dto.py,sha256=s5x4-UXEWccWhK42E0FPXiHG6VqjuFuph-2t5atEkg4,171
62
62
  moonshot/integrations/web_api/schemas/endpoint_create_dto.py,sha256=oyw5xNsWg4GxQ5VNbSe_YqvWxE7OI3egPZINqIi3glw,646
63
63
  moonshot/integrations/web_api/schemas/endpoint_response_model.py,sha256=OmmM2uaPSgB2aqPFfkhseKkI5OKCKilXR19gDmwFlLc,321
64
64
  moonshot/integrations/web_api/schemas/prompt_response_model.py,sha256=S9PwxJERY1ppDaUKLlL9_skHcYcURIIvFnRZj24hLnE,303
65
65
  moonshot/integrations/web_api/schemas/prompt_template_response_model.py,sha256=V7znK-QjQVUXUbsmEy5hZHzjnHYCN1kDtvOxgyxF83k,195
66
66
  moonshot/integrations/web_api/schemas/recipe_create_dto.py,sha256=xXT1TlVM3jVGUH4FPrd64vRctoCV8ybnXga4Nb1VzEU,1117
67
- moonshot/integrations/web_api/schemas/recipe_response_model.py,sha256=qhjiMyr5fc6R3vOZlsellnX2NF5esaBeQAGQ8160mFo,217
67
+ moonshot/integrations/web_api/schemas/recipe_response_model.py,sha256=9ZfNa6HGTz6kxRfRCKCHLfeomfkRWaXcN3X--rldurc,267
68
68
  moonshot/integrations/web_api/schemas/session_create_dto.py,sha256=3Xhj5JOEEWwaoq1q4FZLBVUdpo59C6X6m4y_qLurEhg,493
69
69
  moonshot/integrations/web_api/schemas/session_prompt_dto.py,sha256=AcMq3UhKrZJIEYDrEfK8xPHeTNk2Ex4IDXrDWZwn6Fo,218
70
70
  moonshot/integrations/web_api/schemas/session_response_model.py,sha256=JCFJQ5k5IYPuYYUTRY-LPlVuV5xMclOtOghgUvWGkEg,1021
@@ -79,12 +79,12 @@ moonshot/integrations/web_api/services/benchmark_test_state.py,sha256=MyhTxpAhhP
79
79
  moonshot/integrations/web_api/services/benchmarking_service.py,sha256=lJZeNTqxEPBLrZNX3Z9JIilgwetywSkv0deQkcb8mQs,1257
80
80
  moonshot/integrations/web_api/services/bookmark_service.py,sha256=jI9nXs1hjzO0CLG2LKaXSzDApLThkfCvPUkaNNV9A5A,3546
81
81
  moonshot/integrations/web_api/services/context_strategy_service.py,sha256=6YKnnG8JlE_1nlnr4Hq7rgz-sxI6oQglK0STaWPFQxQ,710
82
- moonshot/integrations/web_api/services/cookbook_service.py,sha256=avAFiX_ZrBvCZcGFuZlp1Zw9AQVSdZ5ysKIS5JfIeh8,6760
83
- moonshot/integrations/web_api/services/dataset_service.py,sha256=WmLyREkb8N44o8gKYtryanqefNjaGMuhzp0OK-wRq04,1710
82
+ moonshot/integrations/web_api/services/cookbook_service.py,sha256=Hi6xKmChS6-fOKXoHqjOkM0cUvNCV3XaNJNVoXMbK0U,7942
83
+ moonshot/integrations/web_api/services/dataset_service.py,sha256=ZWb3FqyDkA0C9qhlQ3X_zR0ohAlwlLsJi-mgKLvXpnI,2407
84
84
  moonshot/integrations/web_api/services/endpoint_service.py,sha256=YhcVYMOCVq7BBWPqf0Doji6YdrtnT6ykJkCjZWj-9xs,2356
85
85
  moonshot/integrations/web_api/services/metric_service.py,sha256=xWC5Dk8aiU7tuHsxYedTTrEkbA3Ug1pV2nbaBas6cAg,456
86
86
  moonshot/integrations/web_api/services/prompt_template_service.py,sha256=5ds7pKDB2R0_0slVDwsCRIpIVdsgpqhI-3wQqSYcpuE,1226
87
- moonshot/integrations/web_api/services/recipe_service.py,sha256=q7hN3yskWnrhR4jUxlv9vHdZLTfXzAZ44vy3HYa7P-c,5465
87
+ moonshot/integrations/web_api/services/recipe_service.py,sha256=Z6cZqwFOVFaksoXK_K05rp5wdZX4qrgMFbw_6fSpjYo,6551
88
88
  moonshot/integrations/web_api/services/runner_service.py,sha256=_ljFTVtMzt3fxlY0l2252KTxgVsqoQB6vsOXBIY0PIU,4584
89
89
  moonshot/integrations/web_api/services/session_service.py,sha256=g0iMGkSAbc2Vx3c9m4aqe15LknsiHgzs7ErV1hHq5nA,13821
90
90
  moonshot/integrations/web_api/services/utils/exceptions_handler.py,sha256=anaQQYLAXzbt-cL4nAZGm1TIlP9fKt7qYE7lrNtW_04,2070
@@ -96,14 +96,14 @@ moonshot/integrations/web_api/status_updater/interface/redteam_progress_callback
96
96
  moonshot/integrations/web_api/temp/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
97
97
  moonshot/integrations/web_api/types/types.py,sha256=AN0Xf61lx2c5AFAYoXA8mVL5iufVBpwYlIPdo8gv-ls,2395
98
98
  moonshot/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
- moonshot/src/messages_constants.py,sha256=pFhm7c2UkdX-XPr62bj6mArf5xrRmktuh_ZiUICJHd0,2352
99
+ moonshot/src/messages_constants.py,sha256=Kig-U3bh2UiDBZxTkRaMKtuwVdSEGxoO6m4ph-54yRk,2442
100
100
  moonshot/src/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
101
101
  moonshot/src/api/api_bookmark.py,sha256=FhtSojdw8wfzJXQnH9VnkwsuqRf_c_y6LH0oOQA48Dc,2926
102
102
  moonshot/src/api/api_connector.py,sha256=JpwLFd7Vh1LRz6oB8fhO2iufMbSTt5RmrMe7nt56bPM,2257
103
103
  moonshot/src/api/api_connector_endpoint.py,sha256=UUuHzrgoj0bWcbOXPUJh7FEg-pzBOSo6DLgwqCZnLmw,5503
104
104
  moonshot/src/api/api_context_strategy.py,sha256=WqzUEw3f7gROJlc_G7bsGkuP3nO1HycFzn3dfcxzaoc,2153
105
105
  moonshot/src/api/api_cookbook.py,sha256=qFItf8KLaDgbDIrv8usbbzSFnoXOYLORQ7IaDvQ5haw,5744
106
- moonshot/src/api/api_dataset.py,sha256=3K6qoLWk6929OBv4W0Qx_Zqx-XgNUm5K16q-RjZBoXY,2670
106
+ moonshot/src/api/api_dataset.py,sha256=z2H-B5yMOdqf-zGoKY7i83cfENfYtUll5tivAE7oAow,4049
107
107
  moonshot/src/api/api_environment_variables.py,sha256=ubUHvK7LyN1HhAE40ZTls6fDrbl6IYbxoPob68i4c_k,551
108
108
  moonshot/src/api/api_metrics.py,sha256=W32Jobh5wUYTsN8Jus0xGvEY1NVkvJrxZ8_a8tVuouI,1586
109
109
  moonshot/src/api/api_prompt_template.py,sha256=NsgEz9sOLLlb93CBDBPektfCDB8kviEGaG21m2onVjo,1332
@@ -113,7 +113,7 @@ moonshot/src/api/api_result.py,sha256=M5zKF7ytKp237UZusLSYJ7QVfui85Ys0WEaYySGcAK
113
113
  moonshot/src/api/api_run.py,sha256=3PrETAVcFnJ09R0-xhWiFkEfqL6eYj4B2voEGJDPznU,2936
114
114
  moonshot/src/api/api_runner.py,sha256=cH0rxWREjc2qKmt4Tuwr-fEMrYDBE_TKRw0jOohNEgU,4179
115
115
  moonshot/src/api/api_session.py,sha256=OGH05ZxAwo_hKI-RNaJ-jCp_v-zcTm-9bHUclpq2z4Q,10978
116
- moonshot/src/bookmark/bookmark.py,sha256=5TJ-q7mGpULqaH5osdB2kThP4bKMIO6nWqrXhvjAy4U,11270
116
+ moonshot/src/bookmark/bookmark.py,sha256=T9dUGtw_l_3PeZT0iO2vFzPiSntX9MFurE9Gcop_JcM,11649
117
117
  moonshot/src/bookmark/bookmark_arguments.py,sha256=cB5m2zB8255WVdacmC2-ZYNyaoK4-gOM_Qwb_JDR-34,1449
118
118
  moonshot/src/configs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
119
119
  moonshot/src/configs/env_variables.py,sha256=eF__UJN37LCzIB4pv_T7G-kQHlOa657QA7IpL1d_0MM,7150
@@ -127,8 +127,8 @@ moonshot/src/cookbooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
127
127
  moonshot/src/cookbooks/cookbook.py,sha256=LjmbJtFwIPhupQlx6LjjIQLMfpwcWZKurduS8MBgqHI,9661
128
128
  moonshot/src/cookbooks/cookbook_arguments.py,sha256=iVp3x1-wi_RL7peTSr5TWbXnjuB_w7Uj29kJrQg48Y0,1210
129
129
  moonshot/src/datasets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
130
- moonshot/src/datasets/dataset.py,sha256=xiq2hYDkhCalddsxjt4i4ur3GlDLHL8kQtonKrpEbb8,14939
131
- moonshot/src/datasets/dataset_arguments.py,sha256=b4FyLA-xBt9e6Itpx6FnTMbyHzvDVMzx4R5SNLqYoXA,1753
130
+ moonshot/src/datasets/dataset.py,sha256=-_uhjR7zi50nkLu1WWlPCCWr14VwFUDfhTeeBHOhb70,14236
131
+ moonshot/src/datasets/dataset_arguments.py,sha256=rUcxxo2WTcHhLLV-WoixjOfT_Ju7hFCq811_ctjegt8,1751
132
132
  moonshot/src/metrics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
133
133
  moonshot/src/metrics/metric.py,sha256=llqJYnwtllJRMfNhRRbKWjhzKymY961yR3Jw24COR-Y,7512
134
134
  moonshot/src/metrics/metric_interface.py,sha256=RSCV8Um39Ns-SD8Os4TM1bwQl3pjaazk5bPRf55aD4Y,4027
@@ -139,7 +139,7 @@ moonshot/src/recipes/recipe.py,sha256=PE4mimP7Y7lDanXib2uMrd9KpLWOxRdg0Cps5rLRQx
139
139
  moonshot/src/recipes/recipe_arguments.py,sha256=9LdVJidB6Sci941QvnudBznvx9_NVCl8r-HvzSZInlY,3914
140
140
  moonshot/src/redteaming/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
141
141
  moonshot/src/redteaming/attack/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
142
- moonshot/src/redteaming/attack/attack_module.py,sha256=HrL7YdsW-wcFB5Dv8t3wkPvg2pf-c9Ep994qdbk1D3s,25061
142
+ moonshot/src/redteaming/attack/attack_module.py,sha256=tbVfLs8FkBSQwpbWMkx6Ad7qrQt778boSG6h68lsLQk,26827
143
143
  moonshot/src/redteaming/attack/attack_module_arguments.py,sha256=L8H6poNj7xNWLUr6jfuSkwE7TNV0aTPaZBal4OvL7IA,1225
144
144
  moonshot/src/redteaming/attack/context_strategy.py,sha256=KiAw85Pl8tuTzQ2d3CkZrjn3Ddp7BnlT5Gc67TTnq4M,4821
145
145
  moonshot/src/redteaming/context_strategy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -163,17 +163,17 @@ moonshot/src/runs/run_progress.py,sha256=d1BcNo6Kp4vA165TDx_xebl8JDo92aV-YutPxsg
163
163
  moonshot/src/runs/run_status.py,sha256=TRtizcDzPxf6aQ2c3OovM6IQKJ0VCBhqDWvn7UBw5Zg,251
164
164
  moonshot/src/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
165
165
  moonshot/src/storage/db_interface.py,sha256=DiiuizZcPlHrdqhesYirrKOQr-SS1N4ymbY4XXHKXfQ,5019
166
- moonshot/src/storage/io_interface.py,sha256=9IpMGtsVbToWBuS-ZRnaZJTMneUV8V0drCxk-OaN3dQ,824
167
- moonshot/src/storage/storage.py,sha256=qQrGFPVzsDwYFrBWa3XLajSjhUtQBwGg4pAr54DFC5Y,22027
166
+ moonshot/src/storage/io_interface.py,sha256=wDs2ofbJWubjULezgzClmiflL5zDzslqmWckTdF2KUU,1546
167
+ moonshot/src/storage/storage.py,sha256=u0L6-q51xLms7o-Y4HRZunYtBnGY-PoEwnRcQL2JBx8,24274
168
168
  moonshot/src/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
169
169
  moonshot/src/utils/find_feature.py,sha256=a5CZMcDJ-Hp2OlV1fRug8Yu32_31KxlMie9lf4_ij9U,1296
170
170
  moonshot/src/utils/import_modules.py,sha256=T9zTN59PFnvY2rjyWhSV9KSIAHxWV1pyBemF0y-hwtw,2844
171
171
  moonshot/src/utils/log.py,sha256=YNgD7Eh2OT36XlmVBKCGUTAh9TRp4Akfe4kDdvHASgs,2502
172
172
  moonshot/src/utils/pagination.py,sha256=5seymyRoqyENIhKllAatr1T91kMCGFslcvRnJHyMSvc,814
173
173
  moonshot/src/utils/timeit.py,sha256=TvuF0w8KWhp0oZFY0cUU3UY0xlGKjchb0OkfYfgVTlc,866
174
- aiverify_moonshot-0.4.8.dist-info/METADATA,sha256=IAMPsICJQHpQB9sMEPWJE_uRcOcA5pOG5JMF080QF5Y,12398
175
- aiverify_moonshot-0.4.8.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
176
- aiverify_moonshot-0.4.8.dist-info/licenses/AUTHORS.md,sha256=mmAbe3i3sT8JZHJMBhxp3i1xRehV0g7WB4T_eyIBuBs,59
177
- aiverify_moonshot-0.4.8.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
178
- aiverify_moonshot-0.4.8.dist-info/licenses/NOTICES.md,sha256=vS1zZYAnGjCJdwQ13xv3b2zc30wOS98ZnCKluT-AhHs,123266
179
- aiverify_moonshot-0.4.8.dist-info/RECORD,,
174
+ aiverify_moonshot-0.4.9.dist-info/METADATA,sha256=vuUKDpxqkTsxqeBCGZ6hAP5LcHl0xyZFklGL1-Fyv7Q,12388
175
+ aiverify_moonshot-0.4.9.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
176
+ aiverify_moonshot-0.4.9.dist-info/licenses/AUTHORS.md,sha256=mmAbe3i3sT8JZHJMBhxp3i1xRehV0g7WB4T_eyIBuBs,59
177
+ aiverify_moonshot-0.4.9.dist-info/licenses/LICENSE.md,sha256=53izDRmJZZCjpYGfyLqlxnGQN-aNWBxasuzuMXC5Ias,11347
178
+ aiverify_moonshot-0.4.9.dist-info/licenses/NOTICES.md,sha256=vS1zZYAnGjCJdwQ13xv3b2zc30wOS98ZnCKluT-AhHs,123266
179
+ aiverify_moonshot-0.4.9.dist-info/RECORD,,
@@ -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 [yyyy] [name of copyright owner]
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.
moonshot/__main__.py CHANGED
@@ -116,36 +116,56 @@ def download_nltk_resources() -> None:
116
116
  raise
117
117
 
118
118
 
119
- def moonshot_data_installation() -> None:
120
- # Code for moonshot-data installation
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
- logger.warning(f"Directory {folder_name} already exists.")
128
- user_input = (
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.info("Exiting function without removing the directory.")
141
- return
142
-
143
- logger.info(f"Cloning {repo}")
144
- # Clone the repository
145
- run_subprocess(["git", "clone", repo], check=True)
146
-
147
- # Create .env to point to installed folder
148
- ms_lib_env_file(folder_name)
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
- # Code for moonshot-ui installation
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
- logger.warning(f"Directory {folder_name} already exists.")
191
- user_input = (
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.info("Exiting function without removing the directory.")
204
- return
205
-
206
- logger.info(f"Cloning {repo}")
207
- # Clone the repository
208
- run_subprocess(["git", "clone", repo], check=True)
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:
moonshot/api.py CHANGED
@@ -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
- "api_create_datasets",
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",
@@ -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 = f"[red]id: {id}[/red]\n\n[blue]{name}[/blue]\n{description}"
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)
@@ -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
+ )
@@ -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(add_dataset_args)
64
- def do_add_dataset(self, args:argparse.Namespace) -> None:
65
- add_dataset(args)
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
  # ------------------------------------------------------------------------------