aiverify-moonshot 0.4.4__py3-none-any.whl → 0.4.6__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.4.dist-info → aiverify_moonshot-0.4.6.dist-info}/METADATA +3 -2
- {aiverify_moonshot-0.4.4.dist-info → aiverify_moonshot-0.4.6.dist-info}/RECORD +28 -26
- moonshot/__main__.py +125 -54
- moonshot/integrations/cli/benchmark/cookbook.py +226 -42
- moonshot/integrations/cli/benchmark/datasets.py +53 -8
- moonshot/integrations/cli/benchmark/metrics.py +48 -7
- moonshot/integrations/cli/benchmark/recipe.py +283 -42
- moonshot/integrations/cli/benchmark/result.py +73 -30
- moonshot/integrations/cli/benchmark/run.py +43 -11
- moonshot/integrations/cli/benchmark/runner.py +29 -20
- moonshot/integrations/cli/cli_errors.py +511 -0
- moonshot/integrations/cli/common/connectors.py +137 -6
- moonshot/integrations/cli/common/dataset.py +66 -13
- moonshot/integrations/cli/common/prompt_template.py +38 -2
- moonshot/integrations/cli/redteam/session.py +126 -43
- moonshot/integrations/web_api/app.py +1 -1
- moonshot/integrations/web_api/routes/bookmark.py +7 -4
- moonshot/src/api/api_bookmark.py +6 -6
- moonshot/src/bookmark/bookmark.py +119 -60
- moonshot/src/bookmark/bookmark_arguments.py +10 -0
- moonshot/src/configs/env_variables.py +7 -3
- moonshot/src/messages_constants.py +40 -0
- moonshot/src/runners/runner.py +1 -1
- moonshot/src/runs/run.py +7 -0
- {aiverify_moonshot-0.4.4.dist-info → aiverify_moonshot-0.4.6.dist-info}/WHEEL +0 -0
- {aiverify_moonshot-0.4.4.dist-info → aiverify_moonshot-0.4.6.dist-info}/licenses/AUTHORS.md +0 -0
- {aiverify_moonshot-0.4.4.dist-info → aiverify_moonshot-0.4.6.dist-info}/licenses/LICENSE.md +0 -0
- {aiverify_moonshot-0.4.4.dist-info → aiverify_moonshot-0.4.6.dist-info}/licenses/NOTICES.md +0 -0
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
# ------------------------------------------------------------------------------
|
|
2
|
+
# Benchmark - add_cookbook
|
|
3
|
+
# ------------------------------------------------------------------------------
|
|
4
|
+
ERROR_BENCHMARK_ADD_COOKBOOK_NAME_VALIDATION = (
|
|
5
|
+
"The 'name' argument must be a non-empty string and not None."
|
|
6
|
+
)
|
|
7
|
+
ERROR_BENCHMARK_ADD_COOKBOOK_DESC_VALIDATION = (
|
|
8
|
+
"The 'description' argument must be a non-empty string and not None."
|
|
9
|
+
)
|
|
10
|
+
ERROR_BENCHMARK_ADD_COOKBOOK_RECIPES_VALIDATION = (
|
|
11
|
+
"The 'recipes' argument must be a non-empty string and not None."
|
|
12
|
+
)
|
|
13
|
+
ERROR_BENCHMARK_ADD_COOKBOOK_RECIPES_LIST_STR_VALIDATION = (
|
|
14
|
+
"The 'recipes' argument must be a list of strings after evaluation."
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
# ------------------------------------------------------------------------------
|
|
18
|
+
# Benchmark - list_cookbook
|
|
19
|
+
# ------------------------------------------------------------------------------
|
|
20
|
+
ERROR_BENCHMARK_LIST_COOKBOOK_FIND_VALIDATION = (
|
|
21
|
+
"The 'find' argument must be a non-empty string and not None."
|
|
22
|
+
)
|
|
23
|
+
ERROR_BENCHMARK_LIST_COOKBOOK_PAGINATION_VALIDATION = (
|
|
24
|
+
"The 'pagination' argument must be a non-empty string and not None."
|
|
25
|
+
)
|
|
26
|
+
ERROR_BENCHMARK_LIST_COOKBOOK_PAGINATION_VALIDATION_1 = (
|
|
27
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
# ------------------------------------------------------------------------------
|
|
31
|
+
# Benchmark - view_cookbook
|
|
32
|
+
# ------------------------------------------------------------------------------
|
|
33
|
+
ERROR_BENCHMARK_VIEW_COOKBOOK_COOKBOOK_VALIDATION = (
|
|
34
|
+
"The 'cookbook' argument must be a non-empty string and not None."
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
# ------------------------------------------------------------------------------
|
|
38
|
+
# Benchmark - run_cookbook
|
|
39
|
+
# ------------------------------------------------------------------------------
|
|
40
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_NAME_VALIDATION = (
|
|
41
|
+
"The 'name' argument must be a non-empty string and not None."
|
|
42
|
+
)
|
|
43
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_COOKBOOKS_VALIDATION = (
|
|
44
|
+
"The 'cookbooks' argument must be a non-empty string and not None."
|
|
45
|
+
)
|
|
46
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_COOKBOOKS_VALIDATION_1 = (
|
|
47
|
+
"The 'cookbooks' argument must evaluate to a list of strings."
|
|
48
|
+
)
|
|
49
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_ENDPOINTS_VALIDATION = (
|
|
50
|
+
"The 'endpoints' argument must be a non-empty string and not None."
|
|
51
|
+
)
|
|
52
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_ENDPOINTS_VALIDATION_1 = (
|
|
53
|
+
"The 'endpoints' argument must evaluate to a list of strings."
|
|
54
|
+
)
|
|
55
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_NUM_OF_PROMPTS_VALIDATION = (
|
|
56
|
+
"The 'num_of_prompts' argument must be an integer."
|
|
57
|
+
)
|
|
58
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_RANDOM_SEED_VALIDATION = (
|
|
59
|
+
"The 'random_seed' argument must be an integer."
|
|
60
|
+
)
|
|
61
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_SYS_PROMPT_VALIDATION = (
|
|
62
|
+
"The 'system_prompt' argument must be a non-empty string and not None."
|
|
63
|
+
)
|
|
64
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_RUNNER_PROC_MOD_VALIDATION = (
|
|
65
|
+
"The 'runner_proc_module' argument must be a non-empty string and not None."
|
|
66
|
+
)
|
|
67
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_RESULT_PROC_MOD_VALIDATION = (
|
|
68
|
+
"The 'result_proc_module' argument must be a non-empty string and not None."
|
|
69
|
+
)
|
|
70
|
+
ERROR_BENCHMARK_RUN_COOKBOOK_NO_RESULT = "There are no results generated."
|
|
71
|
+
|
|
72
|
+
# ------------------------------------------------------------------------------
|
|
73
|
+
# Benchmark - update_cookbook
|
|
74
|
+
# ------------------------------------------------------------------------------
|
|
75
|
+
ERROR_BENCHMARK_UPDATE_COOKBOOK_COOKBOOK_VALIDATION = (
|
|
76
|
+
"The 'cookbook' argument must be a non-empty string and not None."
|
|
77
|
+
)
|
|
78
|
+
ERROR_BENCHMARK_UPDATE_COOKBOOK_UPDATE_VALUES_VALIDATION = (
|
|
79
|
+
"The 'update_values' argument must be a non-empty string and not None."
|
|
80
|
+
)
|
|
81
|
+
ERROR_BENCHMARK_UPDATE_COOKBOOK_UPDATE_VALUES_VALIDATION_1 = (
|
|
82
|
+
"The 'update_values' argument must evaluate to a list of tuples."
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
# ------------------------------------------------------------------------------
|
|
86
|
+
# Benchmark - delete_cookbook
|
|
87
|
+
# ------------------------------------------------------------------------------
|
|
88
|
+
ERROR_BENCHMARK_DELETE_COOKBOOK_COOKBOOK_VALIDATION = (
|
|
89
|
+
"The 'cookbook' argument must be a non-empty string and not None."
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
# ------------------------------------------------------------------------------
|
|
93
|
+
# Benchmark - list_datasets
|
|
94
|
+
# ------------------------------------------------------------------------------
|
|
95
|
+
ERROR_BENCHMARK_LIST_DATASETS_FIND_VALIDATION = (
|
|
96
|
+
"The 'find' argument must be a non-empty string and not None."
|
|
97
|
+
)
|
|
98
|
+
ERROR_BENCHMARK_LIST_DATASETS_PAGINATION_VALIDATION = (
|
|
99
|
+
"The 'pagination' argument must be a non-empty string and not None."
|
|
100
|
+
)
|
|
101
|
+
ERROR_BENCHMARK_LIST_DATASETS_PAGINATION_VALIDATION_1 = (
|
|
102
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
# ------------------------------------------------------------------------------
|
|
106
|
+
# Benchmark - view_dataset
|
|
107
|
+
# ------------------------------------------------------------------------------
|
|
108
|
+
ERROR_BENCHMARK_VIEW_DATASET_DATASET_FILENAME_VALIDATION = (
|
|
109
|
+
"The 'dataset_filename' argument must be a non-empty string and not None."
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
# ------------------------------------------------------------------------------
|
|
113
|
+
# Benchmark - delete_dataset
|
|
114
|
+
# ------------------------------------------------------------------------------
|
|
115
|
+
ERROR_BENCHMARK_DELETE_DATASET_DATASET_VALIDATION = (
|
|
116
|
+
"The 'dataset' argument must be a non-empty string and not None."
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
# ------------------------------------------------------------------------------
|
|
120
|
+
# Benchmark - list_metrics
|
|
121
|
+
# ------------------------------------------------------------------------------
|
|
122
|
+
ERROR_BENCHMARK_LIST_METRICS_FIND_VALIDATION = (
|
|
123
|
+
"The 'find' argument must be a non-empty string and not None."
|
|
124
|
+
)
|
|
125
|
+
ERROR_BENCHMARK_LIST_METRICS_PAGINATION_VALIDATION = (
|
|
126
|
+
"The 'pagination' argument must be a non-empty string and not None."
|
|
127
|
+
)
|
|
128
|
+
ERROR_BENCHMARK_LIST_METRICS_PAGINATION_VALIDATION_1 = (
|
|
129
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
# ------------------------------------------------------------------------------
|
|
133
|
+
# Benchmark - view_metric
|
|
134
|
+
# ------------------------------------------------------------------------------
|
|
135
|
+
ERROR_BENCHMARK_VIEW_METRIC_METRIC_FILENAME_VALIDATION = (
|
|
136
|
+
"The 'metric_filename' argument must be a non-empty string and not None."
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
# ------------------------------------------------------------------------------
|
|
140
|
+
# Benchmark - delete_metric
|
|
141
|
+
# ------------------------------------------------------------------------------
|
|
142
|
+
ERROR_BENCHMARK_DELETE_METRIC_METRIC_VALIDATION = (
|
|
143
|
+
"The 'metric' argument must be a non-empty string and not None."
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
# ------------------------------------------------------------------------------
|
|
147
|
+
# Benchmark - list_results
|
|
148
|
+
# ------------------------------------------------------------------------------
|
|
149
|
+
ERROR_BENCHMARK_LIST_RESULTS_FIND_VALIDATION = (
|
|
150
|
+
"The 'find' argument must be a non-empty string and not None."
|
|
151
|
+
)
|
|
152
|
+
ERROR_BENCHMARK_LIST_RESULTS_PAGINATION_VALIDATION = (
|
|
153
|
+
"The 'pagination' argument must be a non-empty string and not None."
|
|
154
|
+
)
|
|
155
|
+
ERROR_BENCHMARK_LIST_RESULTS_PAGINATION_VALIDATION_1 = (
|
|
156
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
# ------------------------------------------------------------------------------
|
|
160
|
+
# Benchmark - view_result
|
|
161
|
+
# ------------------------------------------------------------------------------
|
|
162
|
+
ERROR_BENCHMARK_VIEW_RESULT_RESULT_FILENAME_VALIDATION = (
|
|
163
|
+
"The 'result_filename' argument must be a non-empty string and not None."
|
|
164
|
+
)
|
|
165
|
+
ERROR_BENCHMARK_VIEW_RESULT_METADATA_VALIDATION = "The 'metadata' argument not found."
|
|
166
|
+
ERROR_BENCHMARK_VIEW_RESULT_METADATA_INVALID_VALIDATION = (
|
|
167
|
+
"Unable to determine cookbook or recipe."
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
# ------------------------------------------------------------------------------
|
|
171
|
+
# Benchmark - delete_result
|
|
172
|
+
# ------------------------------------------------------------------------------
|
|
173
|
+
ERROR_BENCHMARK_DELETE_RESULT_RESULT_VALIDATION = (
|
|
174
|
+
"The 'result' argument must be a non-empty string and not None."
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
# ------------------------------------------------------------------------------
|
|
178
|
+
# Benchmark - list_runs
|
|
179
|
+
# ------------------------------------------------------------------------------
|
|
180
|
+
ERROR_BENCHMARK_LIST_RUNS_FIND_VALIDATION = (
|
|
181
|
+
"The 'find' argument must be a non-empty string and not None."
|
|
182
|
+
)
|
|
183
|
+
ERROR_BENCHMARK_LIST_RUNS_PAGINATION_VALIDATION = (
|
|
184
|
+
"The 'pagination' argument must be a non-empty string and not None."
|
|
185
|
+
)
|
|
186
|
+
ERROR_BENCHMARK_LIST_RUNS_PAGINATION_VALIDATION_1 = (
|
|
187
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
188
|
+
)
|
|
189
|
+
|
|
190
|
+
# ------------------------------------------------------------------------------
|
|
191
|
+
# Benchmark - view_run
|
|
192
|
+
# ------------------------------------------------------------------------------
|
|
193
|
+
ERROR_BENCHMARK_VIEW_RUN_RUNNER_ID_VALIDATION = (
|
|
194
|
+
"The 'runner_id' argument must be a non-empty string and not None."
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
# ------------------------------------------------------------------------------
|
|
198
|
+
# Benchmark - add_recipe
|
|
199
|
+
# ------------------------------------------------------------------------------
|
|
200
|
+
ERROR_BENCHMARK_ADD_RECIPE_NAME_VALIDATION = (
|
|
201
|
+
"The 'name' argument must be a non-empty string and not None."
|
|
202
|
+
)
|
|
203
|
+
ERROR_BENCHMARK_ADD_RECIPE_DESC_VALIDATION = (
|
|
204
|
+
"The 'description' argument must be a non-empty string and not None."
|
|
205
|
+
)
|
|
206
|
+
ERROR_BENCHMARK_ADD_RECIPE_TAGS_VALIDATION = (
|
|
207
|
+
"The 'tags' argument must be a non-empty string and not None."
|
|
208
|
+
)
|
|
209
|
+
ERROR_BENCHMARK_ADD_RECIPE_TAGS_LIST_STR_VALIDATION = (
|
|
210
|
+
"The 'tags' argument must be a list of strings after evaluation."
|
|
211
|
+
)
|
|
212
|
+
ERROR_BENCHMARK_ADD_RECIPE_CATEGORIES_VALIDATION = (
|
|
213
|
+
"The 'categories' argument must be a non-empty string and not None."
|
|
214
|
+
)
|
|
215
|
+
ERROR_BENCHMARK_ADD_RECIPE_CATEGORIES_LIST_STR_VALIDATION = (
|
|
216
|
+
"The 'categories' argument must be a list of strings after evaluation."
|
|
217
|
+
)
|
|
218
|
+
ERROR_BENCHMARK_ADD_RECIPE_DATASETS_VALIDATION = (
|
|
219
|
+
"The 'datasets' argument must be a non-empty string and not None."
|
|
220
|
+
)
|
|
221
|
+
ERROR_BENCHMARK_ADD_RECIPE_DATASETS_LIST_STR_VALIDATION = (
|
|
222
|
+
"The 'datasets' argument must be a list of strings after evaluation."
|
|
223
|
+
)
|
|
224
|
+
ERROR_BENCHMARK_ADD_RECIPE_PROMPT_TEMPLATES_VALIDATION = (
|
|
225
|
+
"The 'prompt_templates' argument must be a non-empty string and not None."
|
|
226
|
+
)
|
|
227
|
+
ERROR_BENCHMARK_ADD_RECIPE_PROMPT_TEMPLATES_LIST_STR_VALIDATION = (
|
|
228
|
+
"The 'prompt_templates' argument must be a list of strings after evaluation."
|
|
229
|
+
)
|
|
230
|
+
ERROR_BENCHMARK_ADD_RECIPE_METRICS_VALIDATION = (
|
|
231
|
+
"The 'metrics' argument must be a non-empty string and not None."
|
|
232
|
+
)
|
|
233
|
+
ERROR_BENCHMARK_ADD_RECIPE_METRICS_LIST_STR_VALIDATION = (
|
|
234
|
+
"The 'metrics' argument must be a list of strings after evaluation."
|
|
235
|
+
)
|
|
236
|
+
ERROR_BENCHMARK_ADD_RECIPE_GRADING_SCALE_VALIDATION = (
|
|
237
|
+
"The 'grading_scale' argument must be a non-empty string and not None."
|
|
238
|
+
)
|
|
239
|
+
ERROR_BENCHMARK_ADD_RECIPE_GRADING_SCALE_DICT_STR_VALIDATION = (
|
|
240
|
+
"The 'grading_scale' argument must be a dictionary after evaluation."
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
# ------------------------------------------------------------------------------
|
|
244
|
+
# Benchmark - list_recipes
|
|
245
|
+
# ------------------------------------------------------------------------------
|
|
246
|
+
ERROR_BENCHMARK_LIST_RECIPES_FIND_VALIDATION = (
|
|
247
|
+
"The 'find' argument must be a non-empty string and not None."
|
|
248
|
+
)
|
|
249
|
+
ERROR_BENCHMARK_LIST_RECIPES_PAGINATION_VALIDATION = (
|
|
250
|
+
"The 'pagination' argument must be a non-empty string and not None."
|
|
251
|
+
)
|
|
252
|
+
ERROR_BENCHMARK_LIST_RECIPES_PAGINATION_VALIDATION_1 = (
|
|
253
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
# ------------------------------------------------------------------------------
|
|
257
|
+
# Benchmark - view_recipe
|
|
258
|
+
# ------------------------------------------------------------------------------
|
|
259
|
+
ERROR_BENCHMARK_VIEW_RECIPE_RECIPE_VALIDATION = (
|
|
260
|
+
"The 'recipe' argument must be a non-empty string and not None."
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
# ------------------------------------------------------------------------------
|
|
264
|
+
# Benchmark - run_recipe
|
|
265
|
+
# ------------------------------------------------------------------------------
|
|
266
|
+
ERROR_BENCHMARK_RUN_RECIPE_NAME_VALIDATION = (
|
|
267
|
+
"The 'name' argument must be a non-empty string and not None."
|
|
268
|
+
)
|
|
269
|
+
ERROR_BENCHMARK_RUN_RECIPE_RECIPES_VALIDATION = (
|
|
270
|
+
"The 'recipes' argument must be a non-empty string and not None."
|
|
271
|
+
)
|
|
272
|
+
ERROR_BENCHMARK_RUN_RECIPE_RECIPES_VALIDATION_1 = (
|
|
273
|
+
"The 'recipes' argument must evaluate to a list of strings."
|
|
274
|
+
)
|
|
275
|
+
ERROR_BENCHMARK_RUN_RECIPE_ENDPOINTS_VALIDATION = (
|
|
276
|
+
"The 'endpoints' argument must be a non-empty string and not None."
|
|
277
|
+
)
|
|
278
|
+
ERROR_BENCHMARK_RUN_RECIPE_ENDPOINTS_VALIDATION_1 = (
|
|
279
|
+
"The 'endpoints' argument must evaluate to a list of strings."
|
|
280
|
+
)
|
|
281
|
+
ERROR_BENCHMARK_RUN_RECIPE_NUM_OF_PROMPTS_VALIDATION = (
|
|
282
|
+
"The 'num_of_prompts' argument must be an integer."
|
|
283
|
+
)
|
|
284
|
+
ERROR_BENCHMARK_RUN_RECIPE_RANDOM_SEED_VALIDATION = (
|
|
285
|
+
"The 'random_seed' argument must be an integer."
|
|
286
|
+
)
|
|
287
|
+
ERROR_BENCHMARK_RUN_RECIPE_SYS_PROMPT_VALIDATION = (
|
|
288
|
+
"The 'system_prompt' argument must be a non-empty string and not None."
|
|
289
|
+
)
|
|
290
|
+
ERROR_BENCHMARK_RUN_RECIPE_RUNNER_PROC_MOD_VALIDATION = (
|
|
291
|
+
"The 'runner_proc_module' argument must be a non-empty string and not None."
|
|
292
|
+
)
|
|
293
|
+
ERROR_BENCHMARK_RUN_RECIPE_RESULT_PROC_MOD_VALIDATION = (
|
|
294
|
+
"The 'result_proc_module' argument must be a non-empty string and not None."
|
|
295
|
+
)
|
|
296
|
+
ERROR_BENCHMARK_RUN_RECIPE_NO_RESULT = "There are no results generated."
|
|
297
|
+
|
|
298
|
+
# ------------------------------------------------------------------------------
|
|
299
|
+
# Benchmark - update_recipe
|
|
300
|
+
# ------------------------------------------------------------------------------
|
|
301
|
+
ERROR_BENCHMARK_UPDATE_RECIPE_RECIPE_VALIDATION = (
|
|
302
|
+
"The 'recipe' argument must be a non-empty string and not None."
|
|
303
|
+
)
|
|
304
|
+
ERROR_BENCHMARK_UPDATE_RECIPE_UPDATE_VALUES_VALIDATION = (
|
|
305
|
+
"The 'update_values' argument must be a non-empty string and not None."
|
|
306
|
+
)
|
|
307
|
+
ERROR_BENCHMARK_UPDATE_RECIPE_UPDATE_VALUES_VALIDATION_1 = (
|
|
308
|
+
"The 'update_values' argument must evaluate to a list of tuples."
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
# ------------------------------------------------------------------------------
|
|
312
|
+
# Benchmark - delete_recipe
|
|
313
|
+
# ------------------------------------------------------------------------------
|
|
314
|
+
ERROR_BENCHMARK_DELETE_RECIPE_RECIPE_VALIDATION = (
|
|
315
|
+
"The 'recipe' argument must be a non-empty string and not None."
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
# ------------------------------------------------------------------------------
|
|
319
|
+
# Benchmark - view_runner
|
|
320
|
+
# ------------------------------------------------------------------------------
|
|
321
|
+
ERROR_BENCHMARK_VIEW_RUNNER_RUNNER_VALIDATION = (
|
|
322
|
+
"The 'runner' argument must be a non-empty string and not None."
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
# ------------------------------------------------------------------------------
|
|
326
|
+
# Benchmark - delete_runner
|
|
327
|
+
# ------------------------------------------------------------------------------
|
|
328
|
+
ERROR_BENCHMARK_DELETE_RUNNER_RUNNER_VALIDATION = (
|
|
329
|
+
"The 'runner' argument must be a non-empty string and not None."
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
# ------------------------------------------------------------------------------
|
|
333
|
+
# Common - add_endpoint
|
|
334
|
+
# ------------------------------------------------------------------------------
|
|
335
|
+
ERROR_COMMON_ADD_ENDPOINT_NAME_VALIDATION = (
|
|
336
|
+
"The 'name' argument must be a non-empty string and not None."
|
|
337
|
+
)
|
|
338
|
+
ERROR_COMMON_ADD_ENDPOINT_CONNECTOR_TYPE_VALIDATION = (
|
|
339
|
+
"The 'connector_type' argument must be a non-empty string and not None."
|
|
340
|
+
)
|
|
341
|
+
ERROR_COMMON_ADD_ENDPOINT_URI_VALIDATION = (
|
|
342
|
+
"The 'uri' argument must be a non-empty string and not None."
|
|
343
|
+
)
|
|
344
|
+
ERROR_COMMON_ADD_ENDPOINT_TOKEN_VALIDATION = (
|
|
345
|
+
"The 'token' argument must be a non-empty string and not None."
|
|
346
|
+
)
|
|
347
|
+
ERROR_COMMON_ADD_ENDPOINT_MAX_CALLS_PER_SECOND_VALIDATION = "The 'max_calls_per_second' argument must be a non-empty positive integer and not None." # noqa: E501
|
|
348
|
+
ERROR_COMMON_ADD_ENDPOINT_MAX_CONCURRENCY_VALIDATION = (
|
|
349
|
+
"The 'max_concurrency' argument must be a non-empty positive integer and not None."
|
|
350
|
+
)
|
|
351
|
+
ERROR_COMMON_ADD_ENDPOINT_PARAMS_VALIDATION = (
|
|
352
|
+
"The 'params' argument must be a string representation of a dictionary."
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
# ------------------------------------------------------------------------------
|
|
356
|
+
# Common - list_endpoints
|
|
357
|
+
# ------------------------------------------------------------------------------
|
|
358
|
+
ERROR_COMMON_LIST_ENDPOINTS_FIND_VALIDATION = (
|
|
359
|
+
"The 'find' argument must be a non-empty string and not None."
|
|
360
|
+
)
|
|
361
|
+
ERROR_COMMON_LIST_ENDPOINTS_PAGINATION_VALIDATION = (
|
|
362
|
+
"The 'pagination' argument must be a non-empty string and not None."
|
|
363
|
+
)
|
|
364
|
+
ERROR_COMMON_LIST_ENDPOINTS_PAGINATION_VALIDATION_1 = (
|
|
365
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
# ------------------------------------------------------------------------------
|
|
369
|
+
# Common - list_connector_types
|
|
370
|
+
# ------------------------------------------------------------------------------
|
|
371
|
+
ERROR_COMMON_LIST_CONNECTOR_TYPES_FIND_VALIDATION = (
|
|
372
|
+
"The 'find' argument must be a non-empty string and not None."
|
|
373
|
+
)
|
|
374
|
+
ERROR_COMMON_LIST_CONNECTOR_TYPES_PAGINATION_VALIDATION = (
|
|
375
|
+
"The 'pagination' argument must be a non-empty string and not None."
|
|
376
|
+
)
|
|
377
|
+
ERROR_COMMON_LIST_CONNECTOR_TYPES_PAGINATION_VALIDATION_1 = (
|
|
378
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
379
|
+
)
|
|
380
|
+
|
|
381
|
+
# ------------------------------------------------------------------------------
|
|
382
|
+
# Common - view_endpoint
|
|
383
|
+
# ------------------------------------------------------------------------------
|
|
384
|
+
ERROR_COMMON_VIEW_ENDPOINT_ENDPOINT_VALIDATION = (
|
|
385
|
+
"The 'endpoint' argument must be a non-empty string and not None."
|
|
386
|
+
)
|
|
387
|
+
|
|
388
|
+
# ------------------------------------------------------------------------------
|
|
389
|
+
# Common - update_endpoint
|
|
390
|
+
# ------------------------------------------------------------------------------
|
|
391
|
+
ERROR_COMMON_UPDATE_ENDPOINT_ENDPOINT_VALIDATION = (
|
|
392
|
+
"The 'endpoint' argument must be a non-empty string and not None."
|
|
393
|
+
)
|
|
394
|
+
ERROR_COMMON_UPDATE_ENDPOINT_VALUES_VALIDATION = (
|
|
395
|
+
"The 'update_values' argument must be a non-empty string and not None."
|
|
396
|
+
)
|
|
397
|
+
ERROR_COMMON_UPDATE_ENDPOINT_VALUES_VALIDATION_1 = (
|
|
398
|
+
"The 'update_values' argument must evaluate to a list of tuples."
|
|
399
|
+
)
|
|
400
|
+
|
|
401
|
+
# ------------------------------------------------------------------------------
|
|
402
|
+
# Common - delete_endpoint
|
|
403
|
+
# ------------------------------------------------------------------------------
|
|
404
|
+
ERROR_COMMON_DELETE_ENDPOINT_ENDPOINT_VALIDATION = (
|
|
405
|
+
"The 'endpoint' argument must be a non-empty string and not None."
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
# ------------------------------------------------------------------------------
|
|
409
|
+
# Common - add_dataset
|
|
410
|
+
# ------------------------------------------------------------------------------
|
|
411
|
+
ERROR_COMMON_ADD_DATASET_NAME_VALIDATION = (
|
|
412
|
+
"The 'name' argument must be a non-empty string and not None."
|
|
413
|
+
)
|
|
414
|
+
ERROR_COMMON_ADD_DATASET_DESC_VALIDATION = (
|
|
415
|
+
"The 'description' argument must be a non-empty string and not None."
|
|
416
|
+
)
|
|
417
|
+
ERROR_COMMON_ADD_DATASET_REFERENCE_VALIDATION = (
|
|
418
|
+
"The 'reference' argument must be a non-empty string and not None."
|
|
419
|
+
)
|
|
420
|
+
ERROR_COMMON_ADD_DATASET_LICENSE_VALIDATION = (
|
|
421
|
+
"The 'license' argument must be a non-empty string and not None."
|
|
422
|
+
)
|
|
423
|
+
ERROR_COMMON_ADD_DATASET_METHOD_VALIDATION = "The 'method' argument must be a non-empty string and not None. It must be either 'hf' or 'csv'." # noqa: E501
|
|
424
|
+
ERROR_COMMON_ADD_DATASET_PARAMS_VALIDATION = (
|
|
425
|
+
"The 'params' argument must be a non-empty dictionary and not None."
|
|
426
|
+
)
|
|
427
|
+
|
|
428
|
+
# ------------------------------------------------------------------------------
|
|
429
|
+
# Common - list_prompt_templates
|
|
430
|
+
# ------------------------------------------------------------------------------
|
|
431
|
+
ERROR_COMMON_LIST_PROMPT_TEMPLATES_FIND_VALIDATION = (
|
|
432
|
+
"The 'find' argument must be a non-empty string and not None."
|
|
433
|
+
)
|
|
434
|
+
ERROR_COMMON_LIST_CONNECTOR_TYPES_PAGINATION_VALIDATION = (
|
|
435
|
+
"The 'pagination' argument must be a non-empty string and not None."
|
|
436
|
+
)
|
|
437
|
+
ERROR_COMMON_LIST_CONNECTOR_TYPES_PAGINATION_VALIDATION_1 = (
|
|
438
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
# ------------------------------------------------------------------------------
|
|
442
|
+
# Common - delete_prompt_template
|
|
443
|
+
# ------------------------------------------------------------------------------
|
|
444
|
+
ERROR_COMMON_DELETE_PROMPT_TEMPLATE_PROMPT_TEMPLATE_VALIDATION = (
|
|
445
|
+
"The 'prompt_template' argument must be a non-empty string and not None."
|
|
446
|
+
)
|
|
447
|
+
|
|
448
|
+
# ------------------------------------------------------------------------------
|
|
449
|
+
# Redteaming - new_session
|
|
450
|
+
# ------------------------------------------------------------------------------
|
|
451
|
+
ERROR_RED_TEAMING_NEW_SESSION_PARAMS_VALIDATION = (
|
|
452
|
+
"Invalid or missing required parameter: {param}"
|
|
453
|
+
)
|
|
454
|
+
ERROR_RED_TEAMING_NEW_SESSION_PARAMS_VALIDATION_1 = (
|
|
455
|
+
"Invalid type for parameter: {param}. Expecting type: {param_type}."
|
|
456
|
+
)
|
|
457
|
+
ERROR_RED_TEAMING_NEW_SESSION_ENDPOINTS_VALIDATION = (
|
|
458
|
+
"Invalid type for parameter: endpoints. Expecting type list."
|
|
459
|
+
)
|
|
460
|
+
ERROR_RED_TEAMING_NEW_SESSION_FAILED_TO_USE_SESSION = "Failed to use session."
|
|
461
|
+
|
|
462
|
+
# ------------------------------------------------------------------------------
|
|
463
|
+
# Redteaming - use_session
|
|
464
|
+
# ------------------------------------------------------------------------------
|
|
465
|
+
ERROR_RED_TEAMING_USE_SESSION_RUNNER_ID_VALIDATION = (
|
|
466
|
+
"Invalid or missing required parameter: runner_id"
|
|
467
|
+
)
|
|
468
|
+
ERROR_RED_TEAMING_USE_SESSION_RUNNER_ID_TYPE_VALIDATION = (
|
|
469
|
+
"Invalid type for parameter: runner_id. Expecting type str."
|
|
470
|
+
)
|
|
471
|
+
ERROR_RED_TEAMING_USE_SESSION_NO_SESSION_METADATA_VALIDATION = (
|
|
472
|
+
"[Session] Cannot find a session with the existing Runner ID. Please try again."
|
|
473
|
+
)
|
|
474
|
+
|
|
475
|
+
# ------------------------------------------------------------------------------
|
|
476
|
+
# Redteaming - show_prompts
|
|
477
|
+
# ------------------------------------------------------------------------------
|
|
478
|
+
ERROR_RED_TEAMING_SHOW_PROMPTS_NO_ACTIVE_SESSION_VALIDATION = (
|
|
479
|
+
"There is no active session. Activate a session to show a chat table."
|
|
480
|
+
)
|
|
481
|
+
|
|
482
|
+
# ------------------------------------------------------------------------------
|
|
483
|
+
# Redteaming - list_sessions
|
|
484
|
+
# ------------------------------------------------------------------------------
|
|
485
|
+
ERROR_RED_TEAMING_LIST_SESSIONS_FIND_VALIDATION = (
|
|
486
|
+
"Invalid type for parameter: find. Expecting type str."
|
|
487
|
+
)
|
|
488
|
+
ERROR_RED_TEAMING_LIST_SESSIONS_PAGINATION_VALIDATION = (
|
|
489
|
+
"Invalid type for parameter: pagination. Expecting type str."
|
|
490
|
+
)
|
|
491
|
+
ERROR_RED_TEAMING_LIST_SESSIONS_PAGINATION_VALIDATION_1 = (
|
|
492
|
+
"The 'pagination' argument must be a tuple of two integers."
|
|
493
|
+
)
|
|
494
|
+
|
|
495
|
+
# ------------------------------------------------------------------------------
|
|
496
|
+
# Redteaming - add_bookmark
|
|
497
|
+
# ------------------------------------------------------------------------------
|
|
498
|
+
ERROR_RED_TEAMING_ADD_BOOKMARK_ENDPOINT_VALIDATION = (
|
|
499
|
+
"Incorrect endpoint. Please select a valid endpoint in this session."
|
|
500
|
+
)
|
|
501
|
+
ERROR_RED_TEAMING_ADD_BOOKMARK_ENDPOINT_VALIDATION_1 = "Unable to find prompt ID in the of prompts for endpoint {endpoint}. Please select a valid ID." # noqa: E501
|
|
502
|
+
ERROR_RED_TEAMING_ADD_BOOKMARK_NO_ACTIVE_SESSION = (
|
|
503
|
+
"There is no active session. Activate a session to bookmark a prompt."
|
|
504
|
+
)
|
|
505
|
+
|
|
506
|
+
# ------------------------------------------------------------------------------
|
|
507
|
+
# Redteaming - use_bookmark
|
|
508
|
+
# ------------------------------------------------------------------------------
|
|
509
|
+
ERROR_RED_TEAMING_USE_BOOKMARK_NO_ACTIVE_SESSION = (
|
|
510
|
+
"There is no active session. Activate a session to bookmark a prompt."
|
|
511
|
+
)
|