@iblai/iblai-js 2.76.0 → 2.77.0
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.
- package/dist/data-layer/playwright/evaluation-tab-helpers.d.ts +181 -68
- package/dist/playwright/index.cjs +414 -164
- package/dist/playwright/index.cjs.map +1 -1
- package/dist/playwright/index.d.ts +181 -69
- package/dist/playwright/index.esm.js +407 -165
- package/dist/playwright/index.esm.js.map +1 -1
- package/dist/playwright/playwright/evaluation-tab-helpers.d.ts +181 -68
- package/dist/security/playwright/evaluation-tab-helpers.d.ts +181 -68
- package/dist/web-containers/playwright/evaluation-tab-helpers.d.ts +181 -68
- package/dist/web-containers/source/activity-empty-state.js +2 -2
- package/dist/web-containers/source/activity-empty-state.js.map +1 -1
- package/dist/web-containers/source/activity-tab/activity-empty-state.js +2 -2
- package/dist/web-containers/source/activity-tab/activity-empty-state.js.map +1 -1
- package/dist/web-containers/source/add-items-modal.js +26 -91
- package/dist/web-containers/source/add-items-modal.js.map +1 -1
- package/dist/web-containers/source/benchmark-combobox.js +2 -2
- package/dist/web-containers/source/benchmark-combobox.js.map +1 -1
- package/dist/web-containers/source/benchmark-items-modal.js +28 -7
- package/dist/web-containers/source/benchmark-items-modal.js.map +1 -1
- package/dist/web-containers/source/benchmarks/add-items-modal.js +26 -91
- package/dist/web-containers/source/benchmarks/add-items-modal.js.map +1 -1
- package/dist/web-containers/source/benchmarks/benchmark-items-modal.js +28 -7
- package/dist/web-containers/source/benchmarks/benchmark-items-modal.js.map +1 -1
- package/dist/web-containers/source/benchmarks/create-benchmark-modal.js +166 -20
- package/dist/web-containers/source/benchmarks/create-benchmark-modal.js.map +1 -1
- package/dist/web-containers/source/benchmarks/delete-item-confirm.js +10 -9
- package/dist/web-containers/source/benchmarks/delete-item-confirm.js.map +1 -1
- package/dist/web-containers/source/benchmarks/evals-ui.js +39 -0
- package/dist/web-containers/source/benchmarks/evals-ui.js.map +1 -0
- package/dist/web-containers/source/benchmarks/index.js +30 -11
- package/dist/web-containers/source/benchmarks/index.js.map +1 -1
- package/dist/web-containers/source/benchmarks/qa-form.js +233 -0
- package/dist/web-containers/source/benchmarks/qa-form.js.map +1 -0
- package/dist/web-containers/source/components/activity-tab/activity-empty-state.js +2 -2
- package/dist/web-containers/source/components/activity-tab/activity-empty-state.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
- package/dist/web-containers/source/components/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
- package/dist/web-containers/source/components/platform-sidebar/index.js +2 -0
- package/dist/web-containers/source/components/platform-sidebar/index.js.map +1 -1
- package/dist/web-containers/source/components/profile/benchmarks/add-items-modal.js +26 -91
- package/dist/web-containers/source/components/profile/benchmarks/add-items-modal.js.map +1 -1
- package/dist/web-containers/source/components/profile/benchmarks/benchmark-items-modal.js +28 -7
- package/dist/web-containers/source/components/profile/benchmarks/benchmark-items-modal.js.map +1 -1
- package/dist/web-containers/source/components/profile/benchmarks/create-benchmark-modal.js +166 -20
- package/dist/web-containers/source/components/profile/benchmarks/create-benchmark-modal.js.map +1 -1
- package/dist/web-containers/source/components/profile/benchmarks/delete-item-confirm.js +10 -9
- package/dist/web-containers/source/components/profile/benchmarks/delete-item-confirm.js.map +1 -1
- package/dist/web-containers/source/components/profile/benchmarks/evals-ui.js +39 -0
- package/dist/web-containers/source/components/profile/benchmarks/evals-ui.js.map +1 -0
- package/dist/web-containers/source/components/profile/benchmarks/index.js +30 -11
- package/dist/web-containers/source/components/profile/benchmarks/index.js.map +1 -1
- package/dist/web-containers/source/components/profile/benchmarks/qa-form.js +233 -0
- package/dist/web-containers/source/components/profile/benchmarks/qa-form.js.map +1 -0
- package/dist/web-containers/source/components/rich-text-editor.js +24 -3
- package/dist/web-containers/source/components/rich-text-editor.js.map +1 -1
- package/dist/web-containers/source/create-benchmark-modal.js +166 -20
- package/dist/web-containers/source/create-benchmark-modal.js.map +1 -1
- package/dist/web-containers/source/delete-experiment-modal.js +6 -6
- package/dist/web-containers/source/delete-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/delete-item-confirm.js +10 -9
- package/dist/web-containers/source/delete-item-confirm.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
- package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
- package/dist/web-containers/source/en.json.js +100 -74
- package/dist/web-containers/source/en.json.js.map +1 -1
- package/dist/web-containers/source/es.json.js +81 -55
- package/dist/web-containers/source/es.json.js.map +1 -1
- package/dist/web-containers/source/evals-ui.js +39 -0
- package/dist/web-containers/source/evals-ui.js.map +1 -0
- package/dist/web-containers/source/evaluate-llm-picker.js +7 -6
- package/dist/web-containers/source/evaluate-llm-picker.js.map +1 -1
- package/dist/web-containers/source/evaluation-tab/benchmark-combobox.js +2 -2
- package/dist/web-containers/source/evaluation-tab/benchmark-combobox.js.map +1 -1
- package/dist/web-containers/source/evaluation-tab/delete-experiment-modal.js +6 -6
- package/dist/web-containers/source/evaluation-tab/delete-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/evaluation-tab/evaluate-llm-picker.js +7 -6
- package/dist/web-containers/source/evaluation-tab/evaluate-llm-picker.js.map +1 -1
- package/dist/web-containers/source/evaluation-tab/experiment-detail-modal.js +51 -43
- package/dist/web-containers/source/evaluation-tab/experiment-detail-modal.js.map +1 -1
- package/dist/web-containers/source/evaluation-tab/index.js +68 -37
- package/dist/web-containers/source/evaluation-tab/index.js.map +1 -1
- package/dist/web-containers/source/evaluation-tab/labels.js +68 -46
- package/dist/web-containers/source/evaluation-tab/labels.js.map +1 -1
- package/dist/web-containers/source/evaluation-tab/llm-judge-modal.js +13 -6
- package/dist/web-containers/source/evaluation-tab/llm-judge-modal.js.map +1 -1
- package/dist/web-containers/source/evaluation-tab/start-experiment-modal.js +16 -7
- package/dist/web-containers/source/evaluation-tab/start-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/evaluation-tab/utils.js +14 -1
- package/dist/web-containers/source/evaluation-tab/utils.js.map +1 -1
- package/dist/web-containers/source/experiment-detail-modal.js +51 -43
- package/dist/web-containers/source/experiment-detail-modal.js.map +1 -1
- package/dist/web-containers/source/fr.json.js +82 -56
- package/dist/web-containers/source/fr.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/en.json.js +100 -74
- package/dist/web-containers/source/i18n/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/es.json.js +81 -55
- package/dist/web-containers/source/i18n/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/fr.json.js +82 -56
- package/dist/web-containers/source/i18n/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/zh.json.js +71 -45
- package/dist/web-containers/source/i18n/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/llm-judge-modal.js +13 -6
- package/dist/web-containers/source/llm-judge-modal.js.map +1 -1
- package/dist/web-containers/source/messages/en.json.js +100 -74
- package/dist/web-containers/source/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/messages/es.json.js +81 -55
- package/dist/web-containers/source/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/messages/fr.json.js +82 -56
- package/dist/web-containers/source/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/messages/zh.json.js +71 -45
- package/dist/web-containers/source/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js +2 -2
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/index.js +68 -37
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/index.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js +68 -46
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/labels.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js +13 -6
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js +16 -7
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js +14 -1
- package/dist/web-containers/source/modals/edit-mentor-modal/tabs/evaluation-tab/utils.js.map +1 -1
- package/dist/web-containers/source/platform-sidebar/index.js +2 -0
- package/dist/web-containers/source/platform-sidebar/index.js.map +1 -1
- package/dist/web-containers/source/profile/benchmarks/add-items-modal.js +26 -91
- package/dist/web-containers/source/profile/benchmarks/add-items-modal.js.map +1 -1
- package/dist/web-containers/source/profile/benchmarks/benchmark-items-modal.js +28 -7
- package/dist/web-containers/source/profile/benchmarks/benchmark-items-modal.js.map +1 -1
- package/dist/web-containers/source/profile/benchmarks/create-benchmark-modal.js +166 -20
- package/dist/web-containers/source/profile/benchmarks/create-benchmark-modal.js.map +1 -1
- package/dist/web-containers/source/profile/benchmarks/delete-item-confirm.js +10 -9
- package/dist/web-containers/source/profile/benchmarks/delete-item-confirm.js.map +1 -1
- package/dist/web-containers/source/profile/benchmarks/evals-ui.js +39 -0
- package/dist/web-containers/source/profile/benchmarks/evals-ui.js.map +1 -0
- package/dist/web-containers/source/profile/benchmarks/index.js +30 -11
- package/dist/web-containers/source/profile/benchmarks/index.js.map +1 -1
- package/dist/web-containers/source/profile/benchmarks/qa-form.js +233 -0
- package/dist/web-containers/source/profile/benchmarks/qa-form.js.map +1 -0
- package/dist/web-containers/source/qa-form.js +233 -0
- package/dist/web-containers/source/qa-form.js.map +1 -0
- package/dist/web-containers/source/rich-text-editor.js +24 -3
- package/dist/web-containers/source/rich-text-editor.js.map +1 -1
- package/dist/web-containers/source/start-experiment-modal.js +16 -7
- package/dist/web-containers/source/start-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/tabs/evaluation-tab/benchmark-combobox.js +2 -2
- package/dist/web-containers/source/tabs/evaluation-tab/benchmark-combobox.js.map +1 -1
- package/dist/web-containers/source/tabs/evaluation-tab/delete-experiment-modal.js +6 -6
- package/dist/web-containers/source/tabs/evaluation-tab/delete-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/tabs/evaluation-tab/evaluate-llm-picker.js +7 -6
- package/dist/web-containers/source/tabs/evaluation-tab/evaluate-llm-picker.js.map +1 -1
- package/dist/web-containers/source/tabs/evaluation-tab/experiment-detail-modal.js +51 -43
- package/dist/web-containers/source/tabs/evaluation-tab/experiment-detail-modal.js.map +1 -1
- package/dist/web-containers/source/tabs/evaluation-tab/index.js +68 -37
- package/dist/web-containers/source/tabs/evaluation-tab/index.js.map +1 -1
- package/dist/web-containers/source/tabs/evaluation-tab/labels.js +68 -46
- package/dist/web-containers/source/tabs/evaluation-tab/labels.js.map +1 -1
- package/dist/web-containers/source/tabs/evaluation-tab/llm-judge-modal.js +13 -6
- package/dist/web-containers/source/tabs/evaluation-tab/llm-judge-modal.js.map +1 -1
- package/dist/web-containers/source/tabs/evaluation-tab/start-experiment-modal.js +16 -7
- package/dist/web-containers/source/tabs/evaluation-tab/start-experiment-modal.js.map +1 -1
- package/dist/web-containers/source/tabs/evaluation-tab/utils.js +14 -1
- package/dist/web-containers/source/tabs/evaluation-tab/utils.js.map +1 -1
- package/dist/web-containers/source/tsconfig.build.tsbuildinfo +1 -1
- package/dist/web-containers/source/web-containers/tsconfig.build.tsbuildinfo +1 -1
- package/dist/web-containers/source/zh.json.js +71 -45
- package/dist/web-containers/source/zh.json.js.map +1 -1
- package/dist/web-utils/playwright/evaluation-tab-helpers.d.ts +181 -68
- package/package.json +4 -4
|
@@ -1,54 +1,200 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useState } from 'react';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
3
|
import { toast } from 'sonner';
|
|
4
4
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '../../ui/dialog.js';
|
|
5
5
|
import { Input } from '../../ui/input.js';
|
|
6
6
|
import { Label } from '../../ui/label.js';
|
|
7
7
|
import { Textarea } from '../../ui/textarea.js';
|
|
8
8
|
import { Button } from '../../ui/button.js';
|
|
9
|
-
import {
|
|
9
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from '../../ui/tabs.js';
|
|
10
|
+
import { FieldInfo } from '../../field-info.js';
|
|
11
|
+
import { useLazyListEvalDatasetsQuery, useCreateEvalDatasetMutation } from '@iblai/data-layer';
|
|
10
12
|
import { useT } from '../../../i18n/context.js';
|
|
11
13
|
import '../../../packages/i18n/dist/index.esm.js';
|
|
14
|
+
import { EVALS_DIALOG } from './evals-ui.js';
|
|
15
|
+
import { useQaForm, QaForm } from './qa-form.js';
|
|
16
|
+
import Info from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/info.js';
|
|
12
17
|
import LoaderCircle from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/loader-circle.js';
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
// Every address of a benchmark carries its name as one path segment, so a
|
|
20
|
+
// name with a slash, or one made only of dots, could never be opened again.
|
|
21
|
+
const UNREACHABLE_NAME = /\/|^\.+$/;
|
|
22
|
+
const LABEL_ROW = 'flex h-4 items-center gap-2';
|
|
23
|
+
// The Create Agent dialog's step tabs.
|
|
24
|
+
const STEP_TAB = 'rounded-md bg-gray-100 px-4 py-2 text-sm font-medium text-gray-600 hover:bg-gray-200 data-[state=active]:bg-gradient-to-r data-[state=active]:from-[#2563EB] data-[state=active]:to-[#93C5FD] data-[state=active]:text-white';
|
|
25
|
+
const FIRST_QUESTION_ID = 'benchmark-item-input-0';
|
|
26
|
+
const CSV_FILE_ID = 'benchmark-csv-file';
|
|
27
|
+
const MAX_NAME_MATCHES = 200;
|
|
28
|
+
function CreateBenchmarkModal({ isOpen, onClose, tenantKey, username, onCreated }) {
|
|
15
29
|
const t = useT();
|
|
30
|
+
const [step, setStep] = useState('details');
|
|
16
31
|
const [name, setName] = useState('');
|
|
17
32
|
const [description, setDescription] = useState('');
|
|
18
|
-
const [
|
|
33
|
+
const [nameError, setNameError] = useState(null);
|
|
34
|
+
const [formError, setFormError] = useState(null);
|
|
35
|
+
const [createdName, setCreatedName] = useState(null);
|
|
36
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
37
|
+
const [findDatasets] = useLazyListEvalDatasetsQuery();
|
|
38
|
+
const [createDataset, { isLoading: isCreating }] = useCreateEvalDatasetMutation();
|
|
39
|
+
const qa = useQaForm({ tenantKey, username });
|
|
40
|
+
const isBusy = isSubmitting || isCreating || qa.isSaving;
|
|
41
|
+
const isCreated = createdName !== null;
|
|
42
|
+
const hasName = name.trim().length > 0;
|
|
43
|
+
// The retry follows the rule `qa.save` sends by, not the showing tab alone,
|
|
44
|
+
// so Save Q&A stays on for the Q&A that Create has just tried to send.
|
|
45
|
+
const canSubmit = !qa.hasProblem && (isCreated ? !qa.isEmpty : hasName);
|
|
46
|
+
// A name refused at Create comes back to Details while Name is still
|
|
47
|
+
// disabled by the request, so the cursor can only go there once it ends.
|
|
48
|
+
const nameInputRef = useRef(null);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
var _a;
|
|
51
|
+
if (nameError && !isBusy)
|
|
52
|
+
(_a = nameInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
53
|
+
}, [nameError, isBusy]);
|
|
54
|
+
// The first Question is only on the page while the Manual tab is showing.
|
|
55
|
+
// Left on the footer, the cursor would sit on Create and a second Enter
|
|
56
|
+
// would create the benchmark.
|
|
57
|
+
const focusQaField = useRef(false);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
if (step !== 'qa' || !focusQaField.current)
|
|
61
|
+
return;
|
|
62
|
+
focusQaField.current = false;
|
|
63
|
+
(_b = ((_a = document.getElementById(FIRST_QUESTION_ID)) !== null && _a !== void 0 ? _a : document.getElementById(CSV_FILE_ID))) === null || _b === void 0 ? void 0 : _b.focus();
|
|
64
|
+
}, [step]);
|
|
65
|
+
const nameLabel = t('benchmarksCreateBenchmarkModal.nameLabel');
|
|
66
|
+
const descriptionLabel = t('benchmarksCreateBenchmarkModal.descriptionLabel');
|
|
19
67
|
const reset = () => {
|
|
68
|
+
setStep('details');
|
|
20
69
|
setName('');
|
|
21
70
|
setDescription('');
|
|
71
|
+
setNameError(null);
|
|
72
|
+
setFormError(null);
|
|
73
|
+
setCreatedName(null);
|
|
74
|
+
qa.reset();
|
|
22
75
|
};
|
|
23
|
-
const
|
|
24
|
-
if (isLoading)
|
|
25
|
-
return;
|
|
76
|
+
const finish = (created) => {
|
|
26
77
|
reset();
|
|
27
78
|
onClose();
|
|
79
|
+
if (created)
|
|
80
|
+
onCreated === null || onCreated === void 0 ? void 0 : onCreated(created);
|
|
28
81
|
};
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
82
|
+
const handleClose = () => {
|
|
83
|
+
if (isBusy)
|
|
84
|
+
return;
|
|
85
|
+
finish(createdName);
|
|
86
|
+
};
|
|
87
|
+
// The backend answers a second create with the same name by updating the
|
|
88
|
+
// benchmark that already has it, so the Q&A would land in that one.
|
|
89
|
+
const isNameTaken = async (candidate) => {
|
|
90
|
+
const matches = await findDatasets({
|
|
91
|
+
org: tenantKey,
|
|
92
|
+
userId: username,
|
|
93
|
+
name: candidate,
|
|
94
|
+
limit: MAX_NAME_MATCHES,
|
|
95
|
+
}).unwrap();
|
|
96
|
+
return matches.results.some((dataset) => dataset.name === candidate);
|
|
97
|
+
};
|
|
98
|
+
const refuseName = (reason) => {
|
|
99
|
+
setNameError(reason);
|
|
100
|
+
setStep('details');
|
|
101
|
+
};
|
|
102
|
+
const handleNext = () => {
|
|
103
|
+
if (!hasName)
|
|
34
104
|
return;
|
|
105
|
+
if (UNREACHABLE_NAME.test(name.trim())) {
|
|
106
|
+
refuseName('invalid');
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
focusQaField.current = true;
|
|
110
|
+
setStep('qa');
|
|
111
|
+
};
|
|
112
|
+
const createBenchmark = async () => {
|
|
113
|
+
const trimmedName = name.trim();
|
|
114
|
+
if (UNREACHABLE_NAME.test(trimmedName)) {
|
|
115
|
+
refuseName('invalid');
|
|
116
|
+
return null;
|
|
35
117
|
}
|
|
36
118
|
try {
|
|
119
|
+
if (await isNameTaken(trimmedName)) {
|
|
120
|
+
refuseName('taken');
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
37
123
|
await createDataset({
|
|
38
124
|
org: tenantKey,
|
|
39
125
|
userId: username,
|
|
40
|
-
body: { name:
|
|
126
|
+
body: { name: trimmedName, description: description.trim() || undefined },
|
|
41
127
|
}).unwrap();
|
|
42
|
-
toast.success(t('benchmarksCreateBenchmarkModal.successToast'));
|
|
43
|
-
reset();
|
|
44
|
-
onClose();
|
|
45
128
|
}
|
|
46
|
-
catch (
|
|
47
|
-
|
|
48
|
-
|
|
129
|
+
catch (_a) {
|
|
130
|
+
setFormError('create');
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
setCreatedName(trimmedName);
|
|
134
|
+
return trimmedName;
|
|
135
|
+
};
|
|
136
|
+
const handleSubmit = async (event) => {
|
|
137
|
+
event.preventDefault();
|
|
138
|
+
if (step === 'details' && !isCreated) {
|
|
139
|
+
handleNext();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (!canSubmit || isBusy)
|
|
143
|
+
return;
|
|
144
|
+
setNameError(null);
|
|
145
|
+
setFormError(null);
|
|
146
|
+
setIsSubmitting(true);
|
|
147
|
+
try {
|
|
148
|
+
const benchmarkName = createdName !== null && createdName !== void 0 ? createdName : (await createBenchmark());
|
|
149
|
+
if (!benchmarkName)
|
|
150
|
+
return;
|
|
151
|
+
if (qa.isEmpty) {
|
|
152
|
+
toast.success(t('benchmarksCreateBenchmarkModal.successToastNoQa'));
|
|
153
|
+
finish(benchmarkName);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
let count;
|
|
157
|
+
try {
|
|
158
|
+
count = await qa.save(benchmarkName);
|
|
159
|
+
}
|
|
160
|
+
catch (_a) {
|
|
161
|
+
setFormError('qa');
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
toast.success(t('benchmarksCreateBenchmarkModal.successToast', { count }));
|
|
165
|
+
finish(benchmarkName);
|
|
166
|
+
}
|
|
167
|
+
finally {
|
|
168
|
+
setIsSubmitting(false);
|
|
49
169
|
}
|
|
50
170
|
};
|
|
51
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: jsxs(DialogContent, { "aria-label": "create-benchmark", className: "
|
|
171
|
+
return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && handleClose(), children: jsxs(DialogContent, { "aria-label": "create-benchmark", className: "flex max-h-[90vh] w-full max-w-2xl flex-col overflow-hidden",
|
|
172
|
+
// Not the autoFocus attribute: opened from another dialog, that dialog
|
|
173
|
+
// takes the focus back and it then lands on the Name info icon.
|
|
174
|
+
onOpenAutoFocus: (event) => {
|
|
175
|
+
var _a;
|
|
176
|
+
event.preventDefault();
|
|
177
|
+
(_a = nameInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
178
|
+
}, children: [jsxs(DialogHeader, { className: "flex-none", children: [jsx(DialogTitle, { children: t('benchmarksCreateBenchmarkModal.title') }), jsx(DialogDescription, { children: t('benchmarksCreateBenchmarkModal.description') })] }), jsxs("form", { onSubmit: handleSubmit, className: "flex min-h-0 flex-1 flex-col gap-4", children: [jsxs(Tabs, { value: step, onValueChange: (next) => setStep(next), className: "flex min-h-0 flex-1 flex-col gap-4", children: [jsxs(TabsList, { className: "flex-none justify-start self-start", children: [jsx(TabsTrigger, { value: "details", disabled: isBusy, className: STEP_TAB, children: t('benchmarksCreateBenchmarkModal.detailsTab') }), jsx(TabsTrigger, { value: "qa", disabled: isBusy || !hasName, className: STEP_TAB, children: t('benchmarksCreateBenchmarkModal.qaTab') })] }), jsxs("div", { className: EVALS_DIALOG.scrollBody, children: [jsxs(TabsContent, { value: "details", className: "mt-0 grid content-start gap-4", children: [jsxs("div", { className: "grid gap-1.5", children: [jsxs("div", { className: LABEL_ROW, children: [jsx(Label, { htmlFor: "benchmark-name", children: nameLabel }), jsx(FieldInfo, { label: nameLabel, text: t('benchmarksCreateBenchmarkModal.nameInfo') })] }), jsx(Input, { ref: nameInputRef, id: "benchmark-name", value: name, onChange: (event) => {
|
|
179
|
+
setName(event.target.value);
|
|
180
|
+
setNameError(null);
|
|
181
|
+
}, placeholder: t('benchmarksCreateBenchmarkModal.namePlaceholder'), maxLength: 255, disabled: isBusy || isCreated,
|
|
182
|
+
// Details is unmounted while Q&A shows. When the request has
|
|
183
|
+
// already ended, the effect above runs before Name is back.
|
|
184
|
+
autoFocus: nameError !== null, "aria-invalid": nameError ? true : undefined, "aria-describedby": nameError ? 'benchmark-name-error' : undefined, className: nameError ? 'border-red-500' : undefined }), nameError && (jsx("p", { id: "benchmark-name-error", role: "alert", className: EVALS_DIALOG.fieldError, children: nameError === 'taken'
|
|
185
|
+
? t('benchmarksCreateBenchmarkModal.nameTaken')
|
|
186
|
+
: t('benchmarksCreateBenchmarkModal.nameInvalid') }))] }), jsxs("div", { className: "grid gap-1.5", children: [jsxs("div", { className: LABEL_ROW, children: [jsx(Label, { htmlFor: "benchmark-description", children: descriptionLabel }), jsx(FieldInfo, { label: descriptionLabel, text: t('benchmarksCreateBenchmarkModal.descriptionInfo') })] }), jsx(Textarea, { id: "benchmark-description", value: description, onChange: (event) => setDescription(event.target.value), placeholder: t('benchmarksCreateBenchmarkModal.descriptionPlaceholder'), rows: 3, disabled: isBusy || isCreated })] })] }), jsxs(TabsContent, { value: "qa", forceMount: true, hidden: step !== 'qa', className: "mt-0 grid min-w-0 content-start gap-4 data-[state=inactive]:hidden", children: [jsxs("p", { "data-testid": "benchmark-qa-hint", className: "flex items-start gap-2 rounded-md border border-gray-200 bg-gray-50 p-3 text-xs text-gray-600", children: [jsx(Info, { className: "mt-px h-3.5 w-3.5 flex-none text-gray-500", "aria-hidden": "true" }), jsx("span", { children: t('benchmarksCreateBenchmarkModal.qaHint') })] }), jsx(QaForm, { form: qa, disabled: isBusy, idPrefix: "benchmark-" })] })] })] }), formError && (jsx("p", { role: "alert", className: `flex-none ${EVALS_DIALOG.fieldError}`, children: formError === 'qa'
|
|
187
|
+
? t('benchmarksCreateBenchmarkModal.qaError')
|
|
188
|
+
: t('benchmarksCreateBenchmarkModal.createError') })), jsxs(DialogFooter, { className: `flex-none ${EVALS_DIALOG.footer}`, children: [jsx(Button, { type: "button", variant: "outline", onClick: handleClose, disabled: isBusy, children: isCreated
|
|
189
|
+
? t('benchmarksCreateBenchmarkModal.close')
|
|
190
|
+
: t('benchmarksCreateBenchmarkModal.cancel') }), step === 'details' && !isCreated ? (jsx(Button, { type: "submit", disabled: isBusy || !hasName, className: EVALS_DIALOG.primaryButton, children: t('benchmarksCreateBenchmarkModal.next') }, "next")) : (jsxs(Button, { type: "submit", disabled: isBusy || !canSubmit,
|
|
191
|
+
// The second click of a double-click on Next lands here.
|
|
192
|
+
onClick: (event) => {
|
|
193
|
+
if (event.detail > 1)
|
|
194
|
+
event.preventDefault();
|
|
195
|
+
}, className: EVALS_DIALOG.primaryButton, children: [isBusy && jsx(LoaderCircle, { className: EVALS_DIALOG.spinner }), isCreated
|
|
196
|
+
? t('benchmarksCreateBenchmarkModal.saveQa')
|
|
197
|
+
: t('benchmarksCreateBenchmarkModal.create')] }, "create"))] })] })] }) }));
|
|
52
198
|
}
|
|
53
199
|
|
|
54
200
|
export { CreateBenchmarkModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-benchmark-modal.js","sources":["../../../../../../../../src/components/profile/benchmarks/create-benchmark-modal.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","Loader2"],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-benchmark-modal.js","sources":["../../../../../../../../src/components/profile/benchmarks/create-benchmark-modal.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","Loader2"],"mappings":";;;;;;;;;;;;;;;;;;AAoCA;AACA;AACA,MAAM,gBAAgB,GAAG,UAAU;AAEnC,MAAM,SAAS,GAAG,6BAA6B;AAC/C;AACA,MAAM,QAAQ,GACZ,8NAA8N;AAChO,MAAM,iBAAiB,GAAG,wBAAwB;AAClD,MAAM,WAAW,GAAG,oBAAoB;AACxC,MAAM,gBAAgB,GAAG,GAAG;AAEtB,SAAU,oBAAoB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAS,EAAA;AAC7F,IAAA,MAAM,CAAC,GAAG,IAAI,EAAE;IAChB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAO,SAAS,CAAC;IACjD,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;IACpC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;IAClD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAmB,IAAI,CAAC;IAClE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAmB,IAAI,CAAC;IAClE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC;IACnE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;AAEvD,IAAA,MAAM,CAAC,YAAY,CAAC,GAAG,4BAA4B,EAAE;AACrD,IAAA,MAAM,CAAC,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ader, DialogTitle, DialogFooter } from '../../../../ui/dialog.js';
|
|
3
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '../../../../ui/dialog.js';
|
|
4
4
|
import { Button } from '../../../../ui/button.js';
|
|
5
|
+
import { EVALS_DIALOG } from '../../../../profile/benchmarks/evals-ui.js';
|
|
5
6
|
import { useDeleteEvalRunMutation } from '@iblai/data-layer';
|
|
7
|
+
import LoaderCircle from '../../../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/loader-circle.js';
|
|
6
8
|
|
|
7
9
|
function DeleteExperimentModal({ isOpen, onClose, tenantKey, username, datasetName, runName, labels, }) {
|
|
8
10
|
const [deleteRun, { isLoading }] = useDeleteEvalRunMutation();
|
|
9
11
|
const handleDelete = async () => {
|
|
10
|
-
var _a;
|
|
11
12
|
try {
|
|
12
13
|
await deleteRun({
|
|
13
14
|
org: tenantKey,
|
|
@@ -18,12 +19,11 @@ function DeleteExperimentModal({ isOpen, onClose, tenantKey, username, datasetNa
|
|
|
18
19
|
toast.success(labels.successToast);
|
|
19
20
|
onClose();
|
|
20
21
|
}
|
|
21
|
-
catch (
|
|
22
|
-
|
|
23
|
-
toast.error(detail || labels.errorToast);
|
|
22
|
+
catch (_a) {
|
|
23
|
+
toast.error(labels.errorToast);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && !isLoading && onClose(), children: jsxs(DialogContent, { "aria-label": "delete-evaluation", className: "max-w-md
|
|
26
|
+
return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && !isLoading && onClose(), children: jsxs(DialogContent, { "aria-label": "delete-evaluation", className: "w-full max-w-md", children: [jsxs(DialogHeader, { className: "min-w-0", children: [jsx(DialogTitle, { children: labels.title }), jsx(DialogDescription, { className: "break-words", children: labels.confirmation.replace('{runName}', () => runName) })] }), jsxs(DialogFooter, { className: EVALS_DIALOG.footer, children: [jsx(Button, { type: "button", variant: "outline", onClick: onClose, disabled: isLoading, children: labels.cancel }), jsxs(Button, { type: "button", className: EVALS_DIALOG.primaryButton, onClick: handleDelete, disabled: isLoading, children: [isLoading && jsx(LoaderCircle, { className: EVALS_DIALOG.spinner }), isLoading ? labels.confirming : labels.confirm] })] })] }) }));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export { DeleteExperimentModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-experiment-modal.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete-experiment-modal.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","Loader2"],"mappings":";;;;;;;;SA6BgB,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,OAAO,EACP,MAAM,GACA,EAAA;IACN,MAAM,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,wBAAwB,EAAE;AAE7D,IAAA,MAAM,YAAY,GAAG,YAAW;AAC9B,QAAA,IAAI;AACF,YAAA,MAAM,SAAS,CAAC;AACd,gBAAA,GAAG,EAAE,SAAS;AACd,gBAAA,MAAM,EAAE,QAAQ;gBAChB,WAAW;gBACX,OAAO;aACR,CAAC,CAAC,MAAM,EAAE;AACX,YAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;AAClC,YAAA,OAAO,EAAE;QACX;AAAE,QAAA,OAAA,EAAA,EAAM;AACN,YAAA,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;QAChC;AACF,IAAA,CAAC;AAED,IAAA,QACEA,GAAA,CAAC,MAAM,EAAA,EAAC,IA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ialogFooter } from '../../ui/dialog.js';
|
|
3
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '../../ui/dialog.js';
|
|
4
4
|
import { Button } from '../../ui/button.js';
|
|
5
5
|
import { useDeleteEvalDatasetItemMutation } from '@iblai/data-layer';
|
|
6
6
|
import { useT } from '../../../i18n/context.js';
|
|
7
7
|
import '../../../packages/i18n/dist/index.esm.js';
|
|
8
|
+
import { EVALS_DIALOG } from './evals-ui.js';
|
|
9
|
+
import LoaderCircle from '../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/loader-circle.js';
|
|
8
10
|
|
|
9
|
-
function DeleteItemConfirm({ isOpen, onClose, tenantKey, username, datasetName, itemId, }) {
|
|
11
|
+
function DeleteItemConfirm({ isOpen, onClose, tenantKey, username, datasetName, itemId, onDeleted, }) {
|
|
10
12
|
const t = useT();
|
|
11
13
|
const [deleteItem, { isLoading }] = useDeleteEvalDatasetItemMutation();
|
|
12
14
|
const handleDelete = async () => {
|
|
13
|
-
var _a;
|
|
14
15
|
try {
|
|
15
16
|
await deleteItem({
|
|
16
17
|
org: tenantKey,
|
|
@@ -19,16 +20,16 @@ function DeleteItemConfirm({ isOpen, onClose, tenantKey, username, datasetName,
|
|
|
19
20
|
itemId,
|
|
20
21
|
}).unwrap();
|
|
21
22
|
toast.success(t('benchmarksDeleteItemConfirm.successToast'));
|
|
23
|
+
onDeleted === null || onDeleted === void 0 ? void 0 : onDeleted();
|
|
22
24
|
onClose();
|
|
23
25
|
}
|
|
24
|
-
catch (
|
|
25
|
-
|
|
26
|
-
toast.error(detail || t('benchmarksDeleteItemConfirm.errorToast'));
|
|
26
|
+
catch (_a) {
|
|
27
|
+
toast.error(t('benchmarksDeleteItemConfirm.errorToast'));
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && !isLoading && onClose(), children: jsxs(DialogContent, { "aria-label": "delete-benchmark-item", className: "max-w-md
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && !isLoading && onClose(), children: jsxs(DialogContent, { "aria-label": "delete-benchmark-item", className: "w-full max-w-md", children: [jsxs(DialogHeader, { className: "min-w-0", children: [jsx(DialogTitle, { children: t('benchmarksDeleteItemConfirm.title') }), jsx(DialogDescription, { className: "break-words", children: t('benchmarksDeleteItemConfirm.confirmation') })] }), jsxs(DialogFooter, { className: EVALS_DIALOG.footer, children: [jsx(Button, { type: "button", variant: "outline", onClick: onClose, disabled: isLoading, children: t('benchmarksDeleteItemConfirm.cancel') }), jsxs(Button, { type: "button", className: EVALS_DIALOG.primaryButton, onClick: handleDelete, disabled: isLoading, children: [isLoading && jsx(LoaderCircle, { className: EVALS_DIALOG.spinner }), isLoading
|
|
31
|
+
? t('benchmarksDeleteItemConfirm.deleting')
|
|
32
|
+
: t('benchmarksDeleteItemConfirm.delete')] })] })] }) }));
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export { DeleteItemConfirm };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-item-confirm.js","sources":["../../../../../../../../src/components/profile/benchmarks/delete-item-confirm.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete-item-confirm.js","sources":["../../../../../../../../src/components/profile/benchmarks/delete-item-confirm.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","Loader2"],"mappings":";;;;;;;;;;SA4BgB,iBAAiB,CAAC,EAChC,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,MAAM,EACN,SAAS,GACH,EAAA;AACN,IAAA,MAAM,CAAC,GAAG,IAAI,EAAE;IAChB,MAAM,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,gCAAgC,EAAE;AAEtE,IAAA,MAAM,YAAY,GAAG,YAAW;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AE,SAAS,EAAA,QAAA,EAC1E,CAAC,CAAC,oCAAoC,CAAC,GACjC,EACTC,IAAA,CAAC,MAAM,EAAA,EACL,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,YAAY,CAAC,aAAa,EACrC,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,SAAS,EAAA,QAAA,EAAA,CAElB,SAAS,IAAID,GAAA,CAACE,YAAO,EAAA,EAAC,SAAS,EAAE,YAAY,CAAC,OAAO,EAAA,CAAI,EACzD;AACC,sCAAE,CAAC,CAAC,sCAAsC;sCACxC,CAAC,CAAC,oCAAoC,CAAC,IACpC,CAAA,EAAA,CACI,CAAA,EAAA,CACD,EAAA,CACT;AAEb;;;;"}
|
package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js
CHANGED
|
@@ -42,12 +42,12 @@ function BenchmarkCombobox({ benchmarks, value, onChange, placeholder, searchPla
|
|
|
42
42
|
return benchmarks;
|
|
43
43
|
return benchmarks.filter((name) => name.toLowerCase().includes(query));
|
|
44
44
|
}, [benchmarks, search]);
|
|
45
|
-
const searchAndList = (jsxs(Fragment, { children: [jsxs("div", { className: "flex items-center border-b border-gray-200 px-3", children: [jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), jsx("input", { ref: inputRef, type: "text", value: search, onChange: (event) => setSearch(event.target.value), placeholder: searchPlaceholder, className: "flex h-11 w-full bg-transparent py-3 text-base placeholder:text-muted-foreground focus:outline-none md:h-9 md:text-sm" })] }), jsx("div", { className: "max-h-60 overflow-y-auto py-1", children: filtered.length === 0 ? (jsx("p", { className: "py-6 text-center text-sm text-
|
|
45
|
+
const searchAndList = (jsxs(Fragment, { children: [jsxs("div", { className: "flex items-center border-b border-gray-200 px-3", children: [jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }), jsx("input", { ref: inputRef, type: "text", value: search, onChange: (event) => setSearch(event.target.value), placeholder: searchPlaceholder, className: "flex h-11 w-full bg-transparent py-3 text-base placeholder:text-muted-foreground focus:outline-none md:h-9 md:text-sm" })] }), jsx("div", { className: "max-h-60 overflow-y-auto py-1", children: filtered.length === 0 ? (jsx("p", { className: "py-6 text-center text-sm text-[#646464]", children: emptyMessage })) : (filtered.map((name) => {
|
|
46
46
|
const selected = name === value;
|
|
47
47
|
return (jsxs("button", { type: "button", onClick: () => {
|
|
48
48
|
onChange(name);
|
|
49
49
|
setOpen(false);
|
|
50
|
-
}, className: "relative flex min-h-11 w-full cursor-pointer items-center px-2 py-1.5 text-sm text-gray-800 hover:bg-blue-50 md:min-h-0", children: [jsx(Check, { className: cn('mr-2 h-4 w-4', selected ? 'opacity-100' : 'opacity-0') }), jsx("span", { className: "
|
|
50
|
+
}, className: "relative flex min-h-11 w-full cursor-pointer items-center px-2 py-1.5 text-sm text-gray-800 hover:bg-blue-50 md:min-h-0", children: [jsx(Check, { className: cn('mr-2 h-4 w-4 flex-none', selected ? 'opacity-100' : 'opacity-0') }), jsx("span", { className: "min-w-0 text-left break-words", children: name })] }, name));
|
|
51
51
|
})) })] }));
|
|
52
52
|
return (jsxs("div", { ref: containerRef, className: "relative w-full flex-none md:w-64", children: [jsxs("button", { type: "button", role: "combobox", "data-testid": "benchmark-combobox", "aria-expanded": open, disabled: disabled, onClick: () => setOpen((prev) => !prev), className: "flex h-11 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-1 text-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:h-9", children: [jsx("span", { className: cn('truncate font-normal', !value && 'text-muted-foreground'), children: value || placeholder }), jsx(ChevronsUpDown, { className: "h-4 w-4 shrink-0 opacity-50" })] }), phone ? (jsx(ActivitySheet, { open: open, onClose: () => setOpen(false), title: placeholder, children: jsx("div", { "data-testid": "benchmark-combobox-dropdown", children: searchAndList }) })) : (open && (jsx("div", { "data-testid": "benchmark-combobox-dropdown", className: "absolute top-full left-0 z-50 mt-1 w-full overflow-hidden rounded-md border border-gray-200 bg-white shadow-md", children: searchAndList })))] }));
|
|
53
53
|
}
|
package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"benchmark-combobox.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.tsx"],"sourcesContent":[null],"names":["React","_jsxs","_jsx"],"mappings":";;;;;;;;;;SAkBgB,iBAAiB,CAAC,EAChC,UAAU,EACV,KAAK,EACL,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,QAAQ,GACF,EAAA;AACN,IAAA,MAAM,KAAK,GAAG,gBAAgB,EAAE;AAChC,IAAA,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAGA,cAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC7C,IAAA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAGA,cAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC9C,MAAM,YAAY,GAAGA,cAAK,CAAC,MAAM,CAAiB,IAAI,CAAC;IACvD,MAAM,QAAQ,GAAGA,cAAK,CAAC,MAAM,CAAmB,IAAI,CAAC;AAErD,IAAAA,cAAK,CAAC,SAAS,CAAC,MAAK;QACnB,IAAI,CAAC,IAAI,IAAI,KAAK;YAAE;AACpB,QAAA,MAAM,aAAa,GAAG,CAAC,KAAiB,KAAI;AAC1C,YAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAc;AACnC,YAAA,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAClE,OAAO,CAAC,KAAK,CAAC;YAChB;AACF,QAAA,CAAC;AACD,QAAA,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC;QACrD,OAAO,MAAM,QAAQ,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AC,KAAK,KAAK,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,EAClD,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAC,uHAAuH,EAAA,CACjI,CAAA,EAAA,CACE,EACNA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,+BAA+B,EAAA,QAAA,EAC3C,QAAQ,CAAC,MAAM,KAAK,CAAC,IACpBA,WAAG,SAAS,EAAC,
|
|
1
|
+
{"version":3,"file":"benchmark-combobox.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/evaluation-tab/benchmark-combobox.tsx"],"sourcesContent":[null],"names":["React","_jsxs","_jsx"],"mappings":";;;;;;;;;;SAkBgB,iBAAiB,CAAC,EAChC,UAAU,EACV,KAAK,EACL,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,QAAQ,GACF,EAAA;AACN,IAAA,MAAM,KAAK,GAAG,gBAAgB,EAAE;AAChC,IAAA,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAGA,cAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC7C,IAAA,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAGA,cAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC9C,MAAM,YAAY,GAAGA,cAAK,CAAC,MAAM,CAAiB,IAAI,CAAC;IACvD,MAAM,QAAQ,GAAGA,cAAK,CAAC,MAAM,CAAmB,IAAI,CAAC;AAErD,IAAAA,cAAK,CAAC,SAAS,CAAC,MAAK;QACnB,IAAI,CAAC,IAAI,IAAI,KAAK;YAAE;AACpB,QAAA,MAAM,aAAa,GAAG,CAAC,KAAiB,KAAI;AAC1C,YAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAc;AACnC,YAAA,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAClE,OAAO,CAAC,KAAK,CAAC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B,IAAI,EACnB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,EACvC,SAAS,EAAC,mTAAmT,EAAA,QAAA,EAAA,CAE7TC,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,sBAAsB,EAAE,CAAC,KAAK,IAAI,uBAAuB,CAAC,EAAA,QAAA,EAC3E,KAAK,IAAI,WAAW,EAAA,CAChB,EACPA,GAAA,CAAC,cAAc,EAAA,EAAC,SAAS,EAAC,6BAA6B,EAAA,CAAG,CAAA,EAAA,CACnD,EAER,KAAK,IACJA,GAAA,CAAC,aAAa,EAAA,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,WAAW,EAAA,QAAA,EAC1EA,GAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAiB,6BAA6B,EAAA,QAAA,EAAE,aAAa,EAAA,CAAO,EAAA,CACtD,KAEhB,IAAI,KACFA,GAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EACc,6BAA6B,EACzC,SAAS,EAAC,gHAAgH,EAAA,QAAA,EAEzH,aAAa,EAAA,CACV,CACP,CACF,CAAA,EAAA,CACG;AAEV;;;;"}
|
package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { toast } from 'sonner';
|
|
3
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '../../../../ui/dialog.js';
|
|
3
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from '../../../../ui/dialog.js';
|
|
4
4
|
import { Button } from '../../../../ui/button.js';
|
|
5
|
+
import { EVALS_DIALOG } from '../../../../profile/benchmarks/evals-ui.js';
|
|
5
6
|
import { useDeleteEvalRunMutation } from '@iblai/data-layer';
|
|
7
|
+
import LoaderCircle from '../../../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/loader-circle.js';
|
|
6
8
|
|
|
7
9
|
function DeleteExperimentModal({ isOpen, onClose, tenantKey, username, datasetName, runName, labels, }) {
|
|
8
10
|
const [deleteRun, { isLoading }] = useDeleteEvalRunMutation();
|
|
9
11
|
const handleDelete = async () => {
|
|
10
|
-
var _a;
|
|
11
12
|
try {
|
|
12
13
|
await deleteRun({
|
|
13
14
|
org: tenantKey,
|
|
@@ -18,12 +19,11 @@ function DeleteExperimentModal({ isOpen, onClose, tenantKey, username, datasetNa
|
|
|
18
19
|
toast.success(labels.successToast);
|
|
19
20
|
onClose();
|
|
20
21
|
}
|
|
21
|
-
catch (
|
|
22
|
-
|
|
23
|
-
toast.error(detail || labels.errorToast);
|
|
22
|
+
catch (_a) {
|
|
23
|
+
toast.error(labels.errorToast);
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && !isLoading && onClose(), children: jsxs(DialogContent, { "aria-label": "delete-evaluation", className: "max-w-md
|
|
26
|
+
return (jsx(Dialog, { open: isOpen, onOpenChange: (open) => !open && !isLoading && onClose(), children: jsxs(DialogContent, { "aria-label": "delete-evaluation", className: "w-full max-w-md", children: [jsxs(DialogHeader, { className: "min-w-0", children: [jsx(DialogTitle, { children: labels.title }), jsx(DialogDescription, { className: "break-words", children: labels.confirmation.replace('{runName}', () => runName) })] }), jsxs(DialogFooter, { className: EVALS_DIALOG.footer, children: [jsx(Button, { type: "button", variant: "outline", onClick: onClose, disabled: isLoading, children: labels.cancel }), jsxs(Button, { type: "button", className: EVALS_DIALOG.primaryButton, onClick: handleDelete, disabled: isLoading, children: [isLoading && jsx(LoaderCircle, { className: EVALS_DIALOG.spinner }), isLoading ? labels.confirming : labels.confirm] })] })] }) }));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export { DeleteExperimentModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-experiment-modal.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"delete-experiment-modal.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/evaluation-tab/delete-experiment-modal.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","Loader2"],"mappings":";;;;;;;;SA6BgB,qBAAqB,CAAC,EACpC,MAAM,EACN,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,OAAO,EACP,MAAM,GACA,EAAA;IACN,MAAM,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,wBAAwB,EAAE;AAE7D,IAAA,MAAM,YAAY,GAAG,YAAW;AAC9B,QAAA,IAAI;AACF,YAAA,MAAM,SAAS,CAAC;AACd,gBAAA,GAAG,EAAE,SAAS;AACd,gBAAA,MAAM,EAAE,QAAQ;gBAChB,WAAW;gBACX,OAAO;aACR,CAAC,CAAC,MAAM,EAAE;AACX,YAAA,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC;AAClC,YAAA,OAAO,EAAE;QACX;AAAE,QAAA,OAAA,EAAA,EAAM;AACN,YAAA,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;QAChC;AACF,IAAA,CAAC;AAED,IAAA,QACEA,GAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,IAAI,OAAO,EAAE,EAAA,QAAA,EAC5EC,KAAC,aAAa,EAAA,EAAA,YAAA,EAAY,mBAAmB,EAAC,SAAS,EAAC,iBAAiB,EAAA,QAAA,EAAA,CACvEA,IAAA,CAAC,YAAY,EAAA,EAAC,SAAS,EAAC,SAAS,aAC/BD,GAAA,CAAC,WAAW,EAAA,EAAA,QAAA,EAAE,MAAM,CAAC,KAAK,EAAA,CAAe,EACzCA,GAAA,CAAC,iBAAiB,EAAA,EAAC,SAAS,EAAC,aAAa,YACvC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,EAAA,CACtC,IACP,EACfC,IAAA,CAAC,YAAY,EAAA,EAAC,SAAS,EAAE,YAAY,CAAC,MAAM,aAC1CD,GAAA,CAAC,MAAM,EAAA,EAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAA,QAAA,EAC1E,MAAM,CAAC,MAAM,EAAA,CACP,EACTC,KAAC,MAAM,EAAA,EACL,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,YAAY,CAAC,aAAa,EACrC,OAAO,EAAE,YAAY,EACrB,QAAQ,EAAE,SAAS,aAElB,SAAS,IAAID,GAAA,CAACE,YAAO,IAAC,SAAS,EAAE,YAAY,CAAC,OAAO,EAAA,CAAI,EACzD,SAAS,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAA,EAAA,CACxC,CAAA,EAAA,CACI,CAAA,EAAA,CACD,EAAA,CACT;AAEb;;;;"}
|
package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js
CHANGED
|
@@ -2,16 +2,17 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '../../../../ui/dialog.js';
|
|
4
4
|
import { Button } from '../../../../ui/button.js';
|
|
5
|
-
import {
|
|
6
|
-
import { Spinner } from '../../../../spinner/index.js';
|
|
5
|
+
import { ActivitySearchBox } from '../../../../activity-tab/activity-layout.js';
|
|
7
6
|
import { cn } from '../../../../../lib/utils.js';
|
|
7
|
+
import '../../../../activity-tab/activity-phone.js';
|
|
8
|
+
import '../../../../ui/pagination.js';
|
|
9
|
+
import { Spinner } from '../../../../spinner/index.js';
|
|
8
10
|
import { useGetLlmsQuery } from '@iblai/data-layer';
|
|
9
11
|
import { LLMProviderModal } from '../llm-tab/llm-provider-modal.js';
|
|
10
12
|
import { LLMProviderLogo } from '../llm-tab/provider-logo.js';
|
|
11
13
|
import { llmProviderLabel } from '../llm-tab/utils.js';
|
|
12
14
|
import Bot from '../../../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/bot.js';
|
|
13
15
|
import ChevronDown from '../../../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
14
|
-
import Search from '../../../../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/search.js';
|
|
15
16
|
|
|
16
17
|
function EvaluateLlmPicker({ tenantKey, username, mentorId, value, onChange, placeholder, pickerTitle, pickerDescription, selectorAriaLabel, searchPlaceholder, emptyMessage, logoAlt, disabled, }) {
|
|
17
18
|
var _a, _b, _c;
|
|
@@ -52,11 +53,11 @@ function EvaluateLlmPicker({ tenantKey, username, mentorId, value, onChange, pla
|
|
|
52
53
|
setSelectedProvider(null);
|
|
53
54
|
setShowProviders(false);
|
|
54
55
|
};
|
|
55
|
-
return (jsxs(Fragment, { children: [jsxs(Button, { type: "button", variant: "
|
|
56
|
+
return (jsxs(Fragment, { children: [jsxs(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => setShowProviders(true), "aria-label": selectorAriaLabel, className: "h-9 w-full cursor-pointer justify-start gap-2 bg-transparent px-3 text-sm font-normal", children: [(currentProvider === null || currentProvider === void 0 ? void 0 : currentProvider.logo) ? (jsx(LLMProviderLogo, { logo: currentProvider.logo, label: currentLabel, alt: logoAlt.replace('{name}', () => currentLabel), size: 20, className: "h-5 w-5 flex-shrink-0" })) : (jsx(Bot, { className: "h-5 w-5 flex-shrink-0 text-gray-400" })), jsx("span", { className: cn('min-w-0 flex-1 truncate text-left', !value && 'text-muted-foreground'), children: (value === null || value === void 0 ? void 0 : value.llm_name) || currentLabel || placeholder }), jsx(ChevronDown, { className: "h-4 w-4 shrink-0 opacity-50" })] }), jsx(Dialog, { open: showProviders, onOpenChange: (open) => !open && setShowProviders(false), children: jsxs(DialogContent, { "aria-label": "evaluate-llm-picker", className: "max-h-[90vh] w-full max-w-3xl overflow-y-auto", children: [jsxs(DialogHeader, { children: [jsx(DialogTitle, { children: pickerTitle }), jsx(DialogDescription, { children: pickerDescription })] }), jsx(ActivitySearchBox, { type: "text", placeholder: searchPlaceholder, "aria-label": searchPlaceholder, value: providerSearch, onChange: (event) => setProviderSearch(event.target.value) }), isLoading ? (jsx("div", { className: "flex items-center justify-center py-10", children: jsx(Spinner, {}) })) : (jsxs("div", { className: "grid grid-cols-2 gap-3 sm:grid-cols-3", children: [filteredProviders.map((model) => {
|
|
56
57
|
const label = llmProviderLabel(model);
|
|
57
58
|
const isCurrent = (value === null || value === void 0 ? void 0 : value.llm_provider) === model.name;
|
|
58
|
-
return (jsxs("button", { type: "button", onClick: () => handleProviderClick(model), className: cn('flex cursor-pointer items-center gap-3 rounded-lg border border-gray-200 bg-white p-3 text-left shadow-sm transition-shadow hover:shadow-md', isCurrent && 'border-blue-500'), children: [jsx("div", { className: "h-8 w-8 flex-shrink-0", children: jsx(LLMProviderLogo, { logo: model.logo, label: label, alt: logoAlt.replace('{name}', label) }) }), jsx("span", { className: "
|
|
59
|
-
}), filteredProviders.length === 0 && (jsx("p", { className: "col-span-full py-
|
|
59
|
+
return (jsxs("button", { type: "button", onClick: () => handleProviderClick(model), "aria-pressed": isCurrent, className: cn('flex cursor-pointer items-center gap-3 rounded-lg border border-gray-200 bg-white p-3 text-left shadow-sm transition-shadow hover:shadow-md', isCurrent && 'border-blue-500'), children: [jsx("div", { className: "h-8 w-8 flex-shrink-0", children: jsx(LLMProviderLogo, { logo: model.logo, label: label, alt: logoAlt.replace('{name}', () => label) }) }), jsx("span", { className: "min-w-0 text-sm font-medium break-words text-gray-900", children: label })] }, model.id));
|
|
60
|
+
}), filteredProviders.length === 0 && (jsx("p", { className: "col-span-full py-10 text-center text-sm text-[#646464]", children: emptyMessage }))] }))] }) }), selectedProvider && (jsx(LLMProviderModal, { isOpen: true, onClose: () => setSelectedProvider(null), onSelect: handleSelect, llmProvider: selectedProvider, isSelecting: false, mentorSettings: {
|
|
60
61
|
llm_name: (_b = value === null || value === void 0 ? void 0 : value.llm_name) !== null && _b !== void 0 ? _b : '',
|
|
61
62
|
llm_provider: (_c = value === null || value === void 0 ? void 0 : value.llm_provider) !== null && _c !== void 0 ? _c : '',
|
|
62
63
|
}, llms: (llmProviders !== null && llmProviders !== void 0 ? llmProviders : []) }))] }));
|
package/dist/web-containers/source/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate-llm-picker.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.tsx"],"sourcesContent":[null],"names":["React","_jsxs","_Fragment","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"evaluate-llm-picker.js","sources":["../../../../../../../../../../src/components/modals/edit-mentor-modal/tabs/evaluation-tab/evaluate-llm-picker.tsx"],"sourcesContent":[null],"names":["React","_jsxs","_Fragment","_jsx"],"mappings":";;;;;;;;;;;;;;;;AA4CM,SAAU,iBAAiB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,QAAQ,GACF,EAAA;;AACN,IAAA,MAAM,CAAC,aAAa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