aiverify-moonshot 0.4.11__py3-none-any.whl → 0.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {aiverify_moonshot-0.4.11.dist-info → aiverify_moonshot-0.5.1.dist-info}/METADATA +6 -5
- {aiverify_moonshot-0.4.11.dist-info → aiverify_moonshot-0.5.1.dist-info}/RECORD +39 -39
- {aiverify_moonshot-0.4.11.dist-info → aiverify_moonshot-0.5.1.dist-info}/WHEEL +1 -1
- moonshot/integrations/cli/benchmark/cookbook.py +1 -5
- moonshot/integrations/cli/benchmark/recipe.py +1 -5
- moonshot/integrations/cli/cli_errors.py +3 -0
- moonshot/integrations/cli/common/connectors.py +22 -10
- moonshot/integrations/cli/common/dataset.py +5 -6
- moonshot/integrations/web_api/app.py +1 -1
- moonshot/integrations/web_api/schemas/cookbook_response_model.py +1 -1
- moonshot/integrations/web_api/schemas/endpoint_create_dto.py +1 -0
- moonshot/integrations/web_api/schemas/recipe_response_model.py +1 -1
- moonshot/integrations/web_api/services/cookbook_service.py +52 -21
- moonshot/integrations/web_api/services/endpoint_service.py +1 -0
- moonshot/integrations/web_api/services/recipe_service.py +36 -15
- moonshot/src/api/api_bookmark.py +16 -5
- moonshot/src/api/api_connector.py +3 -3
- moonshot/src/api/api_connector_endpoint.py +6 -3
- moonshot/src/api/api_context_strategy.py +2 -2
- moonshot/src/api/api_cookbook.py +6 -6
- moonshot/src/api/api_dataset.py +5 -5
- moonshot/src/api/api_environment_variables.py +3 -0
- moonshot/src/api/api_metrics.py +1 -1
- moonshot/src/api/api_prompt_template.py +9 -0
- moonshot/src/api/api_recipe.py +3 -3
- moonshot/src/api/api_red_teaming.py +4 -8
- moonshot/src/api/api_result.py +10 -6
- moonshot/src/api/api_run.py +3 -3
- moonshot/src/api/api_runner.py +7 -6
- moonshot/src/api/api_session.py +11 -7
- moonshot/src/connectors/connector.py +121 -58
- moonshot/src/connectors/connector_prompt_arguments.py +7 -4
- moonshot/src/connectors/connector_response.py +5 -10
- moonshot/src/connectors_endpoints/connector_endpoint.py +32 -20
- moonshot/src/connectors_endpoints/connector_endpoint_arguments.py +4 -1
- moonshot/src/messages_constants.py +85 -3
- {aiverify_moonshot-0.4.11.dist-info → aiverify_moonshot-0.5.1.dist-info}/licenses/AUTHORS.md +0 -0
- {aiverify_moonshot-0.4.11.dist-info → aiverify_moonshot-0.5.1.dist-info}/licenses/LICENSE.md +0 -0
- {aiverify_moonshot-0.4.11.dist-info → aiverify_moonshot-0.5.1.dist-info}/licenses/NOTICES.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: aiverify-moonshot
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.1
|
|
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/
|
|
@@ -24,11 +24,12 @@ Requires-Dist: pydantic==2.8.2
|
|
|
24
24
|
Requires-Dist: pyparsing>=3.1.4
|
|
25
25
|
Requires-Dist: python-dotenv>=1.0.1
|
|
26
26
|
Requires-Dist: python-slugify>=8.0.4
|
|
27
|
+
Requires-Dist: tenacity>=8.5.0
|
|
27
28
|
Requires-Dist: xxhash>=3.5.0
|
|
28
29
|
Provides-Extra: all
|
|
29
30
|
Requires-Dist: cmd2>=2.4.3; extra == 'all'
|
|
30
31
|
Requires-Dist: dependency-injector>=4.41.0; extra == 'all'
|
|
31
|
-
Requires-Dist: fastapi>=0.
|
|
32
|
+
Requires-Dist: fastapi>=0.115.4; extra == 'all'
|
|
32
33
|
Requires-Dist: rich>=13.8.0; extra == 'all'
|
|
33
34
|
Requires-Dist: typing-extensions>=4.12.2; extra == 'all'
|
|
34
35
|
Requires-Dist: uvicorn>=0.30.6; extra == 'all'
|
|
@@ -37,7 +38,7 @@ Requires-Dist: cmd2>=2.4.3; extra == 'cli'
|
|
|
37
38
|
Requires-Dist: rich>=13.8.0; extra == 'cli'
|
|
38
39
|
Provides-Extra: web-api
|
|
39
40
|
Requires-Dist: dependency-injector>=4.41.0; extra == 'web-api'
|
|
40
|
-
Requires-Dist: fastapi>=0.
|
|
41
|
+
Requires-Dist: fastapi>=0.115.4; extra == 'web-api'
|
|
41
42
|
Requires-Dist: typing-extensions>=4.12.2; extra == 'web-api'
|
|
42
43
|
Requires-Dist: uvicorn>=0.30.6; extra == 'web-api'
|
|
43
44
|
Description-Content-Type: text/markdown
|
|
@@ -46,7 +47,7 @@ Description-Content-Type: text/markdown
|
|
|
46
47
|
|
|
47
48
|

|
|
48
49
|
|
|
49
|
-
**Version 0.
|
|
50
|
+
**Version 0.5.1**
|
|
50
51
|
|
|
51
52
|
A simple and modular tool to evaluate any LLM application.
|
|
52
53
|
|
|
@@ -6,20 +6,20 @@ moonshot/integrations/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
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=
|
|
9
|
+
moonshot/integrations/cli/cli_errors.py,sha256=jJ15ngnVJjSByamtOE2Cx79k1mOJnAl36NbCjpPppeM,23672
|
|
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
|
-
moonshot/integrations/cli/benchmark/cookbook.py,sha256=
|
|
12
|
+
moonshot/integrations/cli/benchmark/cookbook.py,sha256=rT4gK88LhATFxsAxWWYExtPVT09oWPHJtJ1HQkLT3yU,29444
|
|
13
13
|
moonshot/integrations/cli/benchmark/datasets.py,sha256=Uq5XMNWUp775sz9jCZUZHHmkumPFI7cHVRueHgWm70Q,8965
|
|
14
14
|
moonshot/integrations/cli/benchmark/metrics.py,sha256=SHs-hIa4CIPyOJtxK2U4D6IRHy3ZNsRtZlAMGvF9Qxw,8310
|
|
15
|
-
moonshot/integrations/cli/benchmark/recipe.py,sha256=
|
|
15
|
+
moonshot/integrations/cli/benchmark/recipe.py,sha256=uAYTBu1EwcCBdf9Iut6eboZ6nBt5_hDwBhru50mZer0,32407
|
|
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
20
|
moonshot/integrations/cli/common/common.py,sha256=RjlIqV82DHVi5CeUjOkC1xYlVAq4mxelDD9MN4Tj4jU,3302
|
|
21
|
-
moonshot/integrations/cli/common/connectors.py,sha256=
|
|
22
|
-
moonshot/integrations/cli/common/dataset.py,sha256=
|
|
21
|
+
moonshot/integrations/cli/common/connectors.py,sha256=bmdZfDHKhii3ejZb5tkT0WnoSYtAGKPk8CpBgIvI5PY,20017
|
|
22
|
+
moonshot/integrations/cli/common/dataset.py,sha256=_H7SgP80Y9WTBwHdSo5GlyqWL6w9nuBNti2ELgzxL3c,12646
|
|
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
|
|
@@ -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=
|
|
37
|
+
moonshot/integrations/web_api/app.py,sha256=14_CWTSuLNyX3zH_vaqFUa4fugOUcOxLqx-IEv0-v34,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
|
|
@@ -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=
|
|
59
|
+
moonshot/integrations/web_api/schemas/cookbook_response_model.py,sha256=COLvaE4Hrz_w-C_HQkB7feztweIr0wkY9h8N6NKNIr8,332
|
|
60
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
|
-
moonshot/integrations/web_api/schemas/endpoint_create_dto.py,sha256=
|
|
62
|
+
moonshot/integrations/web_api/schemas/endpoint_create_dto.py,sha256=WS8AfRybrweoOgZx6K6jiNy1Z6J3IZS1PUNnrRxGKyM,678
|
|
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=
|
|
67
|
+
moonshot/integrations/web_api/schemas/recipe_response_model.py,sha256=2__672E0tgicx6f_i34IxYqc9GnDkUY40bLsAkMWQMw,257
|
|
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=
|
|
82
|
+
moonshot/integrations/web_api/services/cookbook_service.py,sha256=AU2J_YCLIrRlufPgboZ27f89rVVR1zJHXXHwusf_ipc,8877
|
|
83
83
|
moonshot/integrations/web_api/services/dataset_service.py,sha256=ZWb3FqyDkA0C9qhlQ3X_zR0ohAlwlLsJi-mgKLvXpnI,2407
|
|
84
|
-
moonshot/integrations/web_api/services/endpoint_service.py,sha256=
|
|
84
|
+
moonshot/integrations/web_api/services/endpoint_service.py,sha256=N5SXNAh44UNeBpMhA9baL0VZoTx4sHzpy4y7-Ch8O4E,2395
|
|
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=
|
|
87
|
+
moonshot/integrations/web_api/services/recipe_service.py,sha256=Pa3mE7RPY950YpkrepeXlOD703CtZRy-N63jewndwP0,7539
|
|
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,34 +96,34 @@ 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=
|
|
99
|
+
moonshot/src/messages_constants.py,sha256=usbvwitgRdOVY0ARdBbh9uiLNUb6WCdCuSoa64tVMhM,6936
|
|
100
100
|
moonshot/src/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
101
|
-
moonshot/src/api/api_bookmark.py,sha256=
|
|
102
|
-
moonshot/src/api/api_connector.py,sha256=
|
|
103
|
-
moonshot/src/api/api_connector_endpoint.py,sha256=
|
|
104
|
-
moonshot/src/api/api_context_strategy.py,sha256=
|
|
105
|
-
moonshot/src/api/api_cookbook.py,sha256=
|
|
106
|
-
moonshot/src/api/api_dataset.py,sha256=
|
|
107
|
-
moonshot/src/api/api_environment_variables.py,sha256=
|
|
108
|
-
moonshot/src/api/api_metrics.py,sha256=
|
|
109
|
-
moonshot/src/api/api_prompt_template.py,sha256=
|
|
110
|
-
moonshot/src/api/api_recipe.py,sha256=
|
|
111
|
-
moonshot/src/api/api_red_teaming.py,sha256=
|
|
112
|
-
moonshot/src/api/api_result.py,sha256=
|
|
113
|
-
moonshot/src/api/api_run.py,sha256=
|
|
114
|
-
moonshot/src/api/api_runner.py,sha256=
|
|
115
|
-
moonshot/src/api/api_session.py,sha256=
|
|
101
|
+
moonshot/src/api/api_bookmark.py,sha256=gg7uJU7ixZtmJ99S3xdgQgcznkY8SjoJaTBkSsnoWrM,3442
|
|
102
|
+
moonshot/src/api/api_connector.py,sha256=Q_of-aHPuWkbefMJq4uXctJl89G2Tt6J_HfSuf1hE6g,2234
|
|
103
|
+
moonshot/src/api/api_connector_endpoint.py,sha256=lwfhlWNBJ6QotqffmURtjRmxfzbBlSIAZupeSpMt9VU,5584
|
|
104
|
+
moonshot/src/api/api_context_strategy.py,sha256=uRIfNjKJ_Wk9nSrvbPRfrdQLpG0K6kH9rl5tmmHui40,2151
|
|
105
|
+
moonshot/src/api/api_cookbook.py,sha256=KzGCcJjpAs92FZBloojLbmi5nqK3hd_zX8m5jYWKMMM,5715
|
|
106
|
+
moonshot/src/api/api_dataset.py,sha256=i2KwnZ-6fTm_tyn8cRw8iesrGi7_Nh0-1bFuN7m0TVo,4066
|
|
107
|
+
moonshot/src/api/api_environment_variables.py,sha256=wRx6rm95ItyL_uKUAYfSjcPZNbRxKl1GGS4PpWcTE1s,712
|
|
108
|
+
moonshot/src/api/api_metrics.py,sha256=x5DiysTYQsMmcAS2y2XpgvrPobZk7GT2rhO-MaIRun4,1603
|
|
109
|
+
moonshot/src/api/api_prompt_template.py,sha256=HQUl7-HGcxA620cY0vDqqo7CoY9uONkXIOlolduIgbE,1959
|
|
110
|
+
moonshot/src/api/api_recipe.py,sha256=_TJUc8vJqxu5Uti3q2GSQ2uJdj8hqNBFSvBi2NaDnyQ,6135
|
|
111
|
+
moonshot/src/api/api_red_teaming.py,sha256=GBBy4yDAbDuUyeANkGorZJENWceNIzfg30TuiF-Av3Q,2004
|
|
112
|
+
moonshot/src/api/api_result.py,sha256=xZHex_K_PbSr-65LPLr5up4lvu313-VJroR4BBR5JQk,2849
|
|
113
|
+
moonshot/src/api/api_run.py,sha256=ToPYIeTPd2OaOqd20UQ_ie2BQPqLw5aZ_RwRwv9oGpU,2983
|
|
114
|
+
moonshot/src/api/api_runner.py,sha256=spN7ogBGQN7I-c1u_UeKZ7vg02AtCuAl3dFG8CSayQU,4257
|
|
115
|
+
moonshot/src/api/api_session.py,sha256=w-mc_sj3ElQa6FPQqWbK2bFgGTu1ECwYm3tN41xFkes,11130
|
|
116
116
|
moonshot/src/bookmark/bookmark.py,sha256=Gf9wZ5wmJUmatHChr0_3tVyUbPMfpCVeEfujQQjIv18,11867
|
|
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
|
|
120
120
|
moonshot/src/connectors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
121
|
-
moonshot/src/connectors/connector.py,sha256
|
|
122
|
-
moonshot/src/connectors/connector_prompt_arguments.py,sha256=
|
|
123
|
-
moonshot/src/connectors/connector_response.py,sha256=
|
|
121
|
+
moonshot/src/connectors/connector.py,sha256=-2-vp6hPWigdEOwkHAz1SSTGwGsaraZHzHnb_9aD5HI,16272
|
|
122
|
+
moonshot/src/connectors/connector_prompt_arguments.py,sha256=aJX5Jwd9bxWWLhIntXBu5Iu3NKsOcud-dfdBJVgKK58,751
|
|
123
|
+
moonshot/src/connectors/connector_response.py,sha256=kIByU-H7A0NXRxk1Y2XPGZHSJNKzJj6BNkzXqdyZyb0,403
|
|
124
124
|
moonshot/src/connectors_endpoints/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
125
|
-
moonshot/src/connectors_endpoints/connector_endpoint.py,sha256=
|
|
126
|
-
moonshot/src/connectors_endpoints/connector_endpoint_arguments.py,sha256=
|
|
125
|
+
moonshot/src/connectors_endpoints/connector_endpoint.py,sha256=3U4030gKhvDt4e7VD3lac2FG0kxGJ0DSLPTAUKYOPEk,10018
|
|
126
|
+
moonshot/src/connectors_endpoints/connector_endpoint_arguments.py,sha256=0v9mUHki4l22CK8o8UjATAsFDza9Lutbh4QplLiDXs8,2434
|
|
127
127
|
moonshot/src/cookbooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
128
128
|
moonshot/src/cookbooks/cookbook.py,sha256=LjmbJtFwIPhupQlx6LjjIQLMfpwcWZKurduS8MBgqHI,9661
|
|
129
129
|
moonshot/src/cookbooks/cookbook_arguments.py,sha256=iVp3x1-wi_RL7peTSr5TWbXnjuB_w7Uj29kJrQg48Y0,1210
|
|
@@ -172,9 +172,9 @@ moonshot/src/utils/import_modules.py,sha256=T9zTN59PFnvY2rjyWhSV9KSIAHxWV1pyBemF
|
|
|
172
172
|
moonshot/src/utils/log.py,sha256=YNgD7Eh2OT36XlmVBKCGUTAh9TRp4Akfe4kDdvHASgs,2502
|
|
173
173
|
moonshot/src/utils/pagination.py,sha256=5seymyRoqyENIhKllAatr1T91kMCGFslcvRnJHyMSvc,814
|
|
174
174
|
moonshot/src/utils/timeit.py,sha256=TvuF0w8KWhp0oZFY0cUU3UY0xlGKjchb0OkfYfgVTlc,866
|
|
175
|
-
aiverify_moonshot-0.
|
|
176
|
-
aiverify_moonshot-0.
|
|
177
|
-
aiverify_moonshot-0.
|
|
178
|
-
aiverify_moonshot-0.
|
|
179
|
-
aiverify_moonshot-0.
|
|
180
|
-
aiverify_moonshot-0.
|
|
175
|
+
aiverify_moonshot-0.5.1.dist-info/METADATA,sha256=EtBhJ0bmVoTktwS_p6OUI9JMgY6-gjmhUWfGK3Em7Vk,12419
|
|
176
|
+
aiverify_moonshot-0.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
177
|
+
aiverify_moonshot-0.5.1.dist-info/licenses/AUTHORS.md,sha256=mmAbe3i3sT8JZHJMBhxp3i1xRehV0g7WB4T_eyIBuBs,59
|
|
178
|
+
aiverify_moonshot-0.5.1.dist-info/licenses/LICENSE.md,sha256=53izDRmJZZCjpYGfyLqlxnGQN-aNWBxasuzuMXC5Ias,11347
|
|
179
|
+
aiverify_moonshot-0.5.1.dist-info/licenses/NOTICES.md,sha256=vS1zZYAnGjCJdwQ13xv3b2zc30wOS98ZnCKluT-AhHs,123266
|
|
180
|
+
aiverify_moonshot-0.5.1.dist-info/RECORD,,
|
|
@@ -256,11 +256,7 @@ def run_cookbook(args) -> None:
|
|
|
256
256
|
if isinstance(args.random_seed, bool) or not isinstance(args.random_seed, int):
|
|
257
257
|
raise TypeError(ERROR_BENCHMARK_RUN_COOKBOOK_RANDOM_SEED_VALIDATION)
|
|
258
258
|
|
|
259
|
-
if (
|
|
260
|
-
not isinstance(args.system_prompt, str)
|
|
261
|
-
or not args.system_prompt
|
|
262
|
-
or args.system_prompt is None
|
|
263
|
-
):
|
|
259
|
+
if not isinstance(args.system_prompt, str) or args.system_prompt is None:
|
|
264
260
|
raise TypeError(ERROR_BENCHMARK_RUN_COOKBOOK_SYS_PROMPT_VALIDATION)
|
|
265
261
|
|
|
266
262
|
if (
|
|
@@ -337,11 +337,7 @@ def run_recipe(args) -> None:
|
|
|
337
337
|
if isinstance(args.random_seed, bool) or not isinstance(args.random_seed, int):
|
|
338
338
|
raise TypeError(ERROR_BENCHMARK_RUN_RECIPE_RANDOM_SEED_VALIDATION)
|
|
339
339
|
|
|
340
|
-
if (
|
|
341
|
-
not isinstance(args.system_prompt, str)
|
|
342
|
-
or not args.system_prompt
|
|
343
|
-
or args.system_prompt is None
|
|
344
|
-
):
|
|
340
|
+
if not isinstance(args.system_prompt, str) or args.system_prompt is None:
|
|
345
341
|
raise TypeError(ERROR_BENCHMARK_RUN_RECIPE_SYS_PROMPT_VALIDATION)
|
|
346
342
|
|
|
347
343
|
if (
|
|
@@ -348,6 +348,9 @@ ERROR_COMMON_ADD_ENDPOINT_MAX_CALLS_PER_SECOND_VALIDATION = "The 'max_calls_per_
|
|
|
348
348
|
ERROR_COMMON_ADD_ENDPOINT_MAX_CONCURRENCY_VALIDATION = (
|
|
349
349
|
"The 'max_concurrency' argument must be a non-empty positive integer and not None."
|
|
350
350
|
)
|
|
351
|
+
ERROR_COMMON_ADD_ENDPOINT_MODEL_VALIDATION = (
|
|
352
|
+
"The 'model' argument must be a string and not None."
|
|
353
|
+
)
|
|
351
354
|
ERROR_COMMON_ADD_ENDPOINT_PARAMS_VALIDATION = (
|
|
352
355
|
"The 'params' argument must be a string representation of a dictionary."
|
|
353
356
|
)
|
|
@@ -17,6 +17,7 @@ from moonshot.integrations.cli.cli_errors import (
|
|
|
17
17
|
ERROR_COMMON_ADD_ENDPOINT_CONNECTOR_TYPE_VALIDATION,
|
|
18
18
|
ERROR_COMMON_ADD_ENDPOINT_MAX_CALLS_PER_SECOND_VALIDATION,
|
|
19
19
|
ERROR_COMMON_ADD_ENDPOINT_MAX_CONCURRENCY_VALIDATION,
|
|
20
|
+
ERROR_COMMON_ADD_ENDPOINT_MODEL_VALIDATION,
|
|
20
21
|
ERROR_COMMON_ADD_ENDPOINT_NAME_VALIDATION,
|
|
21
22
|
ERROR_COMMON_ADD_ENDPOINT_PARAMS_VALIDATION,
|
|
22
23
|
ERROR_COMMON_ADD_ENDPOINT_TOKEN_VALIDATION,
|
|
@@ -56,6 +57,7 @@ def add_endpoint(args) -> None:
|
|
|
56
57
|
token (str): The access token for the API.
|
|
57
58
|
max_calls_per_second (int): The maximum number of API calls allowed per second.
|
|
58
59
|
max_concurrency (int): The maximum number of concurrent API calls.
|
|
60
|
+
model (str): The model used by the endpoint.
|
|
59
61
|
params (str): A string representation of a dictionary containing additional parameters for the connector.
|
|
60
62
|
|
|
61
63
|
Returns:
|
|
@@ -94,6 +96,9 @@ def add_endpoint(args) -> None:
|
|
|
94
96
|
):
|
|
95
97
|
raise TypeError(ERROR_COMMON_ADD_ENDPOINT_MAX_CONCURRENCY_VALIDATION)
|
|
96
98
|
|
|
99
|
+
if not isinstance(args.model, str) or args.model is None:
|
|
100
|
+
raise TypeError(ERROR_COMMON_ADD_ENDPOINT_MODEL_VALIDATION)
|
|
101
|
+
|
|
97
102
|
try:
|
|
98
103
|
params_dict = literal_eval(args.params)
|
|
99
104
|
except Exception:
|
|
@@ -108,6 +113,7 @@ def add_endpoint(args) -> None:
|
|
|
108
113
|
args.token,
|
|
109
114
|
args.max_calls_per_second,
|
|
110
115
|
args.max_concurrency,
|
|
116
|
+
args.model,
|
|
111
117
|
params_dict,
|
|
112
118
|
)
|
|
113
119
|
print(f"[add_endpoint]: Endpoint ({new_endpoint_id}) created.")
|
|
@@ -123,9 +129,9 @@ def list_endpoints(args) -> list | None:
|
|
|
123
129
|
moonshot.api module. It then displays the endpoints using the _display_endpoints function.
|
|
124
130
|
|
|
125
131
|
Args:
|
|
126
|
-
args: A namespace object from argparse. It should have
|
|
127
|
-
|
|
128
|
-
|
|
132
|
+
args: A namespace object from argparse. It should have the following optional attributes:
|
|
133
|
+
find (str): Optional field to find endpoint(s) with a keyword.
|
|
134
|
+
pagination (str): Optional field to paginate endpoints.
|
|
129
135
|
|
|
130
136
|
Returns:
|
|
131
137
|
list | None: A list of ConnectorEndpoint or None if there is no result.
|
|
@@ -176,9 +182,9 @@ def list_connector_types(args) -> list | None:
|
|
|
176
182
|
moonshot.api module. It then displays the connector types using the _display_connector_types function.
|
|
177
183
|
|
|
178
184
|
Args:
|
|
179
|
-
args: A namespace object from argparse. It should have
|
|
180
|
-
|
|
181
|
-
|
|
185
|
+
args: A namespace object from argparse. It should have the following optional attributes:
|
|
186
|
+
find (str): Optional field to find connector type(s) with a keyword.
|
|
187
|
+
pagination (str): Optional field to paginate connector types.
|
|
182
188
|
|
|
183
189
|
Returns:
|
|
184
190
|
list | None: A list of Connector or None if there is no result.
|
|
@@ -373,7 +379,8 @@ def _display_endpoints(endpoints_list):
|
|
|
373
379
|
|
|
374
380
|
Args:
|
|
375
381
|
endpoints_list (list): A list of endpoints. Each endpoint is a dictionary with keys 'id', 'name',
|
|
376
|
-
'connector_type', 'uri', 'token', 'max_calls_per_second', 'max_concurrency', '
|
|
382
|
+
'connector_type', 'uri', 'token', 'max_calls_per_second', 'max_concurrency', 'model', 'params',
|
|
383
|
+
and 'created_date'.
|
|
377
384
|
|
|
378
385
|
Returns:
|
|
379
386
|
None
|
|
@@ -391,7 +398,8 @@ def _display_endpoints(endpoints_list):
|
|
|
391
398
|
table.add_column("Uri", justify="left", width=10)
|
|
392
399
|
table.add_column("Token", justify="left", width=10)
|
|
393
400
|
table.add_column("Max Calls Per Second", justify="left", width=5)
|
|
394
|
-
table.add_column("Max
|
|
401
|
+
table.add_column("Max Concurrency", justify="left", width=5)
|
|
402
|
+
table.add_column("Model", justify="left", width=5)
|
|
395
403
|
table.add_column("Params", justify="left", width=30)
|
|
396
404
|
table.add_column("Created Date", justify="left", width=8)
|
|
397
405
|
|
|
@@ -404,6 +412,7 @@ def _display_endpoints(endpoints_list):
|
|
|
404
412
|
token,
|
|
405
413
|
max_calls_per_second,
|
|
406
414
|
max_concurrency,
|
|
415
|
+
model,
|
|
407
416
|
params,
|
|
408
417
|
created_date,
|
|
409
418
|
*other_args,
|
|
@@ -419,6 +428,7 @@ def _display_endpoints(endpoints_list):
|
|
|
419
428
|
token,
|
|
420
429
|
str(max_calls_per_second),
|
|
421
430
|
str(max_concurrency),
|
|
431
|
+
str(model),
|
|
422
432
|
escape(str(params)),
|
|
423
433
|
created_date,
|
|
424
434
|
)
|
|
@@ -432,7 +442,7 @@ def _display_endpoints(endpoints_list):
|
|
|
432
442
|
add_endpoint_args = cmd2.Cmd2ArgumentParser(
|
|
433
443
|
description="Add a new endpoint. The 'name' argument will be slugified to create a unique identifier.",
|
|
434
444
|
epilog="Example:\n add_endpoint openai-connector 'OpenAI GPT3.5 Turbo 1106' "
|
|
435
|
-
"MY_URI ADD_YOUR_TOKEN_HERE 1 1 \"{'temperature': 0.5
|
|
445
|
+
"MY_URI ADD_YOUR_TOKEN_HERE 1 1 'gpt-3.5-turbo-1106' \"{'temperature': 0.5}\"",
|
|
436
446
|
)
|
|
437
447
|
add_endpoint_args.add_argument(
|
|
438
448
|
"connector_type",
|
|
@@ -450,6 +460,7 @@ add_endpoint_args.add_argument(
|
|
|
450
460
|
add_endpoint_args.add_argument(
|
|
451
461
|
"max_concurrency", type=int, help="Max concurrency of the new endpoint"
|
|
452
462
|
)
|
|
463
|
+
add_endpoint_args.add_argument("model", type=str, help="Model of the new endpoint")
|
|
453
464
|
add_endpoint_args.add_argument("params", type=str, help="Params of the new endpoint")
|
|
454
465
|
|
|
455
466
|
# Update endpoint arguments
|
|
@@ -457,11 +468,12 @@ update_endpoint_args = cmd2.Cmd2ArgumentParser(
|
|
|
457
468
|
description="Update an endpoint.",
|
|
458
469
|
epilog=(
|
|
459
470
|
"Available keys:\n"
|
|
460
|
-
" name:
|
|
471
|
+
" name: Name of the endpoint\n"
|
|
461
472
|
" uri: URI of the endpoint\n"
|
|
462
473
|
" token: Token of the endpoint\n"
|
|
463
474
|
" max_calls_per_second: Rate limit for max calls per second\n"
|
|
464
475
|
" max_concurrency: Rate limit for max concurrency\n"
|
|
476
|
+
" model: Model of the endpoint\n"
|
|
465
477
|
" params: Extra arguments for the endpoint\n\n"
|
|
466
478
|
"Example:\n"
|
|
467
479
|
" update_endpoint openai-gpt4 \"[('name', 'my-special-openai-endpoint'), "
|
|
@@ -5,13 +5,12 @@ from rich.console import Console
|
|
|
5
5
|
from rich.table import Table
|
|
6
6
|
|
|
7
7
|
from moonshot.api import (
|
|
8
|
+
api_convert_dataset,
|
|
8
9
|
api_delete_dataset,
|
|
10
|
+
api_download_dataset,
|
|
9
11
|
api_get_all_datasets,
|
|
10
12
|
api_get_all_datasets_name,
|
|
11
|
-
api_convert_dataset,
|
|
12
|
-
api_download_dataset
|
|
13
13
|
)
|
|
14
|
-
|
|
15
14
|
from moonshot.integrations.cli.cli_errors import (
|
|
16
15
|
ERROR_BENCHMARK_DELETE_DATASET_DATASET_VALIDATION,
|
|
17
16
|
ERROR_BENCHMARK_LIST_DATASETS_FIND_VALIDATION,
|
|
@@ -19,12 +18,12 @@ from moonshot.integrations.cli.cli_errors import (
|
|
|
19
18
|
ERROR_BENCHMARK_LIST_DATASETS_PAGINATION_VALIDATION_1,
|
|
20
19
|
ERROR_BENCHMARK_VIEW_DATASET_DATASET_FILENAME_VALIDATION,
|
|
21
20
|
)
|
|
22
|
-
|
|
23
21
|
from moonshot.integrations.cli.common.display_helper import display_view_str_format
|
|
24
22
|
from moonshot.integrations.cli.utils.process_data import filter_data
|
|
25
23
|
|
|
26
24
|
console = Console()
|
|
27
25
|
|
|
26
|
+
|
|
28
27
|
def list_datasets(args) -> list | None:
|
|
29
28
|
"""
|
|
30
29
|
List all available datasets.
|
|
@@ -155,6 +154,7 @@ def delete_dataset(args) -> None:
|
|
|
155
154
|
except Exception as e:
|
|
156
155
|
print(f"[delete_dataset]: {str(e)}")
|
|
157
156
|
|
|
157
|
+
|
|
158
158
|
def convert_dataset(args) -> None:
|
|
159
159
|
"""
|
|
160
160
|
Convert an existing dataset to a new format.
|
|
@@ -350,8 +350,7 @@ download_dataset_args.add_argument(
|
|
|
350
350
|
type=literal_eval,
|
|
351
351
|
help=(
|
|
352
352
|
"Params of the new dataset in dictionary format. For example: \n"
|
|
353
|
-
"
|
|
354
|
-
"2. For 'hf' method: \"{'dataset_name': 'cais_mmlu', 'dataset_config': 'college_biology', 'split': 'test', "
|
|
353
|
+
"{'dataset_name': 'cais_mmlu', 'dataset_config': 'college_biology', 'split': 'test', "
|
|
355
354
|
"'input_col': ['questions','choices'], 'target_col': 'answer'}\""
|
|
356
355
|
),
|
|
357
356
|
)
|
|
@@ -71,7 +71,7 @@ def create_app(cfg: providers.Configuration) -> CustomFastAPI:
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
app: CustomFastAPI = CustomFastAPI(
|
|
74
|
-
title="Project Moonshot", version="0.
|
|
74
|
+
title="Project Moonshot", version="0.5.1", **app_kwargs
|
|
75
75
|
)
|
|
76
76
|
|
|
77
77
|
if cfg.cors.enabled():
|
|
@@ -8,4 +8,4 @@ from moonshot.src.cookbooks.cookbook_arguments import (
|
|
|
8
8
|
class CookbookResponseModel(CookbookPydanticModel):
|
|
9
9
|
total_prompt_in_cookbook: Optional[int] = None
|
|
10
10
|
total_dataset_in_cookbook: Optional[int] = None
|
|
11
|
-
|
|
11
|
+
required_config: dict | None = None
|
|
@@ -17,5 +17,6 @@ class EndpointUpdateDTO(ConnectorEndpointPydanticModel):
|
|
|
17
17
|
token: Optional[str] = None
|
|
18
18
|
max_calls_per_second: Optional[int] = None
|
|
19
19
|
max_concurrency: Optional[int] = None
|
|
20
|
+
model: Optional[str] = None
|
|
20
21
|
params: Optional[dict] = None
|
|
21
22
|
created_date: Optional[str] = None
|
|
@@ -5,7 +5,10 @@ from .... import api as moonshot_api
|
|
|
5
5
|
from ..schemas.cookbook_create_dto import CookbookCreateDTO, CookbookUpdateDTO
|
|
6
6
|
from ..schemas.cookbook_response_model import CookbookResponseModel
|
|
7
7
|
from ..services.base_service import BaseService
|
|
8
|
-
from ..services.recipe_service import
|
|
8
|
+
from ..services.recipe_service import (
|
|
9
|
+
get_metric_dependency_in_recipe,
|
|
10
|
+
get_total_prompt_in_recipe,
|
|
11
|
+
)
|
|
9
12
|
from ..services.utils.exceptions_handler import exception_handler
|
|
10
13
|
|
|
11
14
|
|
|
@@ -63,25 +66,28 @@ class CookbookService(BaseService):
|
|
|
63
66
|
if cookbook not in cookbooks_list:
|
|
64
67
|
cookbooks_list.append(cookbook)
|
|
65
68
|
if count:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
(
|
|
70
|
+
cookbook.total_prompt_in_cookbook,
|
|
71
|
+
cookbook.total_dataset_in_cookbook,
|
|
72
|
+
) = get_total_prompt_and_dataset_in_cookbook(cookbook)
|
|
69
73
|
|
|
70
74
|
if tags and cookbooks_recipe_has_tags(tags, cookbook):
|
|
71
75
|
if cookbook not in cookbooks_list:
|
|
72
76
|
cookbooks_list.append(cookbook)
|
|
73
77
|
if count:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
(
|
|
79
|
+
cookbook.total_prompt_in_cookbook,
|
|
80
|
+
cookbook.total_dataset_in_cookbook,
|
|
81
|
+
) = get_total_prompt_and_dataset_in_cookbook(cookbook)
|
|
77
82
|
|
|
78
83
|
if categories and cookbooks_recipe_has_categories(categories, cookbook):
|
|
79
84
|
if cookbook not in cookbooks_list:
|
|
80
85
|
cookbooks_list.append(cookbook)
|
|
81
86
|
if count:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
(
|
|
88
|
+
cookbook.total_prompt_in_cookbook,
|
|
89
|
+
cookbook.total_dataset_in_cookbook,
|
|
90
|
+
) = get_total_prompt_and_dataset_in_cookbook(cookbook)
|
|
85
91
|
|
|
86
92
|
if categories_excluded and cookbooks_recipe_has_categories(
|
|
87
93
|
categories_excluded, cookbook
|
|
@@ -89,7 +95,7 @@ class CookbookService(BaseService):
|
|
|
89
95
|
cookbooks_list.remove(cookbook)
|
|
90
96
|
|
|
91
97
|
for cookbook in cookbooks_list:
|
|
92
|
-
cookbook.
|
|
98
|
+
cookbook.required_config = cookbook_metrics_dependency(cookbook)
|
|
93
99
|
|
|
94
100
|
return cookbooks_list
|
|
95
101
|
|
|
@@ -147,7 +153,9 @@ def get_total_prompt_and_dataset_in_cookbook(cookbook: Cookbook) -> tuple[int, i
|
|
|
147
153
|
int: The total count of prompts within the cookbook.
|
|
148
154
|
"""
|
|
149
155
|
recipes = moonshot_api.api_read_recipes(cookbook.recipes)
|
|
150
|
-
total_prompts, total_datasets = zip(
|
|
156
|
+
total_prompts, total_datasets = zip(
|
|
157
|
+
*(get_total_prompt_in_recipe(Recipe(**recipe)) for recipe in recipes)
|
|
158
|
+
)
|
|
151
159
|
return sum(total_prompts), sum(total_datasets)
|
|
152
160
|
|
|
153
161
|
|
|
@@ -197,25 +205,48 @@ def cookbooks_recipe_has_categories(categories: str, cookbook: Cookbook) -> bool
|
|
|
197
205
|
return True
|
|
198
206
|
return False
|
|
199
207
|
|
|
208
|
+
|
|
200
209
|
@staticmethod
|
|
201
|
-
def
|
|
210
|
+
def cookbook_metrics_dependency(cookbook: Cookbook) -> dict | None:
|
|
202
211
|
"""
|
|
203
|
-
Retrieve a list of endpoint dependencies for all recipes in a given cookbook.
|
|
212
|
+
Retrieve a list of endpoint and configuration dependencies for all recipes in a given cookbook.
|
|
204
213
|
|
|
205
214
|
Args:
|
|
206
215
|
cookbook (Cookbook): The cookbook object containing the recipe IDs.
|
|
207
216
|
|
|
208
217
|
Returns:
|
|
209
|
-
list[str] | None: A
|
|
218
|
+
dict[str, list[str]] | None: A dictionary with aggregated endpoint and configuration dependencies
|
|
219
|
+
if any are found, otherwise None.
|
|
210
220
|
"""
|
|
211
221
|
recipes_in_cookbook = cookbook.recipes
|
|
212
222
|
recipes = moonshot_api.api_read_recipes(recipes_in_cookbook)
|
|
213
|
-
|
|
223
|
+
aggregated_endpoints = set()
|
|
224
|
+
aggregated_configurations = {}
|
|
214
225
|
|
|
215
226
|
for recipe in recipes:
|
|
216
227
|
recipe = Recipe(**recipe)
|
|
217
|
-
|
|
218
|
-
if
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
228
|
+
dependency = get_metric_dependency_in_recipe(recipe)
|
|
229
|
+
if dependency:
|
|
230
|
+
# Aggregate endpoints
|
|
231
|
+
aggregated_endpoints.update(dependency.get("endpoints", []))
|
|
232
|
+
|
|
233
|
+
# Aggregate configurations
|
|
234
|
+
for key, value in dependency.get("configurations", {}).items():
|
|
235
|
+
if key in aggregated_configurations:
|
|
236
|
+
aggregated_configurations[key].extend(
|
|
237
|
+
v for v in value if v not in aggregated_configurations[key]
|
|
238
|
+
)
|
|
239
|
+
else:
|
|
240
|
+
aggregated_configurations[key] = value
|
|
241
|
+
|
|
242
|
+
aggregated_dependencies = {
|
|
243
|
+
"endpoints": list(aggregated_endpoints),
|
|
244
|
+
"configurations": aggregated_configurations,
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
return (
|
|
248
|
+
aggregated_dependencies
|
|
249
|
+
if aggregated_dependencies["endpoints"]
|
|
250
|
+
or aggregated_dependencies["configurations"]
|
|
251
|
+
else None
|
|
252
|
+
)
|
|
@@ -13,6 +13,7 @@ class EndpointService(BaseService):
|
|
|
13
13
|
connector_type=endpoint_data.connector_type,
|
|
14
14
|
uri=endpoint_data.uri,
|
|
15
15
|
token=endpoint_data.token,
|
|
16
|
+
model=endpoint_data.model,
|
|
16
17
|
max_calls_per_second=endpoint_data.max_calls_per_second,
|
|
17
18
|
max_concurrency=endpoint_data.max_concurrency,
|
|
18
19
|
params=endpoint_data.params,
|