@lobehub/chat 1.15.6 → 1.15.8
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/CHANGELOG.md +50 -0
- package/README.md +6 -6
- package/README.zh-CN.md +6 -6
- package/docs/self-hosting/server-database/docker-compose.mdx +2 -2
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +2 -2
- package/locales/ar/knowledgeBase.json +1 -0
- package/locales/ar/ragEval.json +91 -0
- package/locales/bg-BG/knowledgeBase.json +1 -0
- package/locales/bg-BG/ragEval.json +91 -0
- package/locales/de-DE/knowledgeBase.json +1 -0
- package/locales/de-DE/ragEval.json +91 -0
- package/locales/en-US/knowledgeBase.json +1 -0
- package/locales/en-US/ragEval.json +91 -0
- package/locales/es-ES/knowledgeBase.json +1 -0
- package/locales/es-ES/ragEval.json +91 -0
- package/locales/fr-FR/knowledgeBase.json +1 -0
- package/locales/fr-FR/ragEval.json +91 -0
- package/locales/it-IT/knowledgeBase.json +1 -0
- package/locales/it-IT/ragEval.json +91 -0
- package/locales/ja-JP/knowledgeBase.json +1 -0
- package/locales/ja-JP/ragEval.json +91 -0
- package/locales/ko-KR/knowledgeBase.json +1 -0
- package/locales/ko-KR/ragEval.json +91 -0
- package/locales/nl-NL/knowledgeBase.json +1 -0
- package/locales/nl-NL/ragEval.json +91 -0
- package/locales/pl-PL/knowledgeBase.json +1 -0
- package/locales/pl-PL/ragEval.json +91 -0
- package/locales/pt-BR/knowledgeBase.json +1 -0
- package/locales/pt-BR/ragEval.json +91 -0
- package/locales/ru-RU/knowledgeBase.json +1 -0
- package/locales/ru-RU/ragEval.json +91 -0
- package/locales/tr-TR/knowledgeBase.json +1 -0
- package/locales/tr-TR/ragEval.json +91 -0
- package/locales/vi-VN/knowledgeBase.json +1 -0
- package/locales/vi-VN/ragEval.json +91 -0
- package/locales/zh-CN/knowledgeBase.json +1 -0
- package/locales/zh-CN/ragEval.json +91 -0
- package/locales/zh-TW/knowledgeBase.json +1 -0
- package/locales/zh-TW/ragEval.json +91 -0
- package/package.json +2 -1
- package/src/app/(main)/repos/[id]/@menu/Head/index.tsx +4 -13
- package/src/app/(main)/repos/[id]/@menu/Menu/index.tsx +30 -21
- package/src/app/(main)/repos/[id]/@menu/default.tsx +8 -2
- package/src/app/(main)/repos/[id]/evals/components/Container.tsx +25 -0
- package/src/app/(main)/repos/[id]/evals/components/Tabs.tsx +35 -0
- package/src/app/(main)/repos/[id]/evals/dataset/CreateDataset/CreateForm.tsx +72 -0
- package/src/app/(main)/repos/[id]/evals/dataset/CreateDataset/index.tsx +37 -0
- package/src/app/(main)/repos/[id]/evals/dataset/DatasetDetail/index.tsx +126 -0
- package/src/app/(main)/repos/[id]/evals/dataset/DatasetList/Item.tsx +59 -0
- package/src/app/(main)/repos/[id]/evals/dataset/DatasetList/index.tsx +32 -0
- package/src/app/(main)/repos/[id]/evals/dataset/EmptyGuide/index.tsx +33 -0
- package/src/app/(main)/repos/[id]/evals/dataset/page.tsx +47 -0
- package/src/app/(main)/repos/[id]/evals/evaluation/CreateEvaluation/CreateForm.tsx +93 -0
- package/src/app/(main)/repos/[id]/evals/evaluation/CreateEvaluation/index.tsx +28 -0
- package/src/app/(main)/repos/[id]/evals/evaluation/CreateEvaluation/useModal.tsx +39 -0
- package/src/app/(main)/repos/[id]/evals/evaluation/EmptyGuide/index.tsx +25 -0
- package/src/app/(main)/repos/[id]/evals/evaluation/EvaluationList/index.tsx +209 -0
- package/src/app/(main)/repos/[id]/evals/evaluation/page.tsx +32 -0
- package/src/app/(main)/repos/[id]/evals/layout.tsx +22 -0
- package/src/app/(main)/repos/[id]/evals/page.tsx +9 -0
- package/src/app/(main)/repos/[id]/evals/type.ts +5 -0
- package/src/app/(main)/repos/[id]/not-found.tsx +3 -0
- package/src/app/(main)/settings/llm/components/ProviderConfig/index.tsx +2 -2
- package/src/components/FileIcon/index.tsx +2 -2
- package/src/config/featureFlags/schema.ts +3 -1
- package/src/database/server/migrations/0008_add_rag_evals.sql +120 -0
- package/src/database/server/migrations/meta/0008_snapshot.json +3463 -0
- package/src/database/server/migrations/meta/_journal.json +7 -0
- package/src/database/server/models/file.ts +11 -2
- package/src/database/server/models/ragEval/dataset.ts +59 -0
- package/src/database/server/models/ragEval/datasetRecord.ts +87 -0
- package/src/database/server/models/ragEval/evaluation.ts +96 -0
- package/src/database/server/models/ragEval/evaluationRecord.ts +64 -0
- package/src/database/server/models/ragEval/index.ts +4 -0
- package/src/database/server/schemas/lobechat/asyncTask.ts +24 -0
- package/src/database/server/schemas/lobechat/file.ts +2 -18
- package/src/database/server/schemas/lobechat/index.ts +2 -0
- package/src/database/server/schemas/lobechat/ragEvals.ts +105 -0
- package/src/database/server/schemas/lobechat/relations.ts +2 -1
- package/src/libs/agent-runtime/types/chat.ts +3 -0
- package/src/libs/agent-runtime/utils/openaiCompatibleFactory/index.ts +3 -1
- package/src/libs/langchain/loaders/index.ts +1 -1
- package/src/locales/default/index.ts +2 -0
- package/src/locales/default/knowledgeBase.ts +1 -0
- package/src/locales/default/ragEval.ts +93 -0
- package/src/server/modules/S3/index.ts +11 -0
- package/src/server/routers/async/index.ts +2 -0
- package/src/server/routers/async/ragEval.ts +138 -0
- package/src/server/routers/lambda/index.ts +2 -1
- package/src/server/routers/lambda/ragEval.ts +296 -0
- package/src/services/ragEval.ts +67 -0
- package/src/services/upload.ts +11 -4
- package/src/store/file/slices/upload/action.ts +8 -6
- package/src/store/knowledgeBase/initialState.ts +3 -1
- package/src/store/knowledgeBase/slices/ragEval/actions/dataset.ts +88 -0
- package/src/store/knowledgeBase/slices/ragEval/actions/evaluation.ts +62 -0
- package/src/store/knowledgeBase/slices/ragEval/actions/index.ts +20 -0
- package/src/store/knowledgeBase/slices/ragEval/index.ts +2 -0
- package/src/store/knowledgeBase/slices/ragEval/initialState.ts +7 -0
- package/src/store/knowledgeBase/store.ts +9 -3
- package/src/store/serverConfig/selectors.test.ts +1 -0
- package/src/types/eval/dataset.ts +47 -0
- package/src/types/eval/evaluation.ts +53 -0
- package/src/types/eval/index.ts +3 -0
- package/src/types/eval/ragas.ts +9 -0
|
@@ -106,12 +106,14 @@ export const createFileUploadSlice: StateCreator<
|
|
|
106
106
|
});
|
|
107
107
|
} else {
|
|
108
108
|
// 2. if file don't exist, need upload files
|
|
109
|
-
metadata = await uploadService.uploadWithProgress(file,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
metadata = await uploadService.uploadWithProgress(file, {
|
|
110
|
+
onProgress: (status, upload) => {
|
|
111
|
+
onStatusUpdate?.({
|
|
112
|
+
id: file.name,
|
|
113
|
+
type: 'updateFile',
|
|
114
|
+
value: { status: status === 'success' ? 'processing' : status, uploadState: upload },
|
|
115
|
+
});
|
|
116
|
+
},
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
119
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { KnowledgeBaseState, initialKnowledgeBaseState } from '../knowledgeBase/slices/crud';
|
|
2
|
+
import { RAGEvalState, initialDatasetState } from '../knowledgeBase/slices/ragEval';
|
|
2
3
|
|
|
3
|
-
export type KnowledgeBaseStoreState = KnowledgeBaseState;
|
|
4
|
+
export type KnowledgeBaseStoreState = KnowledgeBaseState & RAGEvalState;
|
|
4
5
|
|
|
5
6
|
export const initialState: KnowledgeBaseStoreState = {
|
|
6
7
|
...initialKnowledgeBaseState,
|
|
8
|
+
...initialDatasetState,
|
|
7
9
|
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { SWRResponse, mutate } from 'swr';
|
|
2
|
+
import { StateCreator } from 'zustand/vanilla';
|
|
3
|
+
|
|
4
|
+
import { notification } from '@/components/AntdStaticMethods';
|
|
5
|
+
import { useClientDataSWR } from '@/libs/swr';
|
|
6
|
+
import { ragEvalService } from '@/services/ragEval';
|
|
7
|
+
import { KnowledgeBaseStore } from '@/store/knowledgeBase/store';
|
|
8
|
+
import {
|
|
9
|
+
CreateNewEvalDatasets,
|
|
10
|
+
EvalDatasetRecord,
|
|
11
|
+
RAGEvalDataSetItem,
|
|
12
|
+
insertEvalDatasetRecordSchema,
|
|
13
|
+
} from '@/types/eval';
|
|
14
|
+
|
|
15
|
+
const FETCH_DATASET_LIST_KEY = 'FETCH_DATASET_LIST';
|
|
16
|
+
const FETCH_DATASET_RECORD_KEY = 'FETCH_DATASET_RECORD_KEY';
|
|
17
|
+
|
|
18
|
+
export interface RAGEvalDatasetAction {
|
|
19
|
+
createNewDataset: (params: CreateNewEvalDatasets) => Promise<void>;
|
|
20
|
+
|
|
21
|
+
importDataset: (file: File, datasetId: number) => Promise<void>;
|
|
22
|
+
refreshDatasetList: () => Promise<void>;
|
|
23
|
+
removeDataset: (id: number) => Promise<void>;
|
|
24
|
+
useFetchDatasetRecords: (datasetId: number | null) => SWRResponse<EvalDatasetRecord[]>;
|
|
25
|
+
useFetchDatasets: (knowledgeBaseId: string) => SWRResponse<RAGEvalDataSetItem[]>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const createRagEvalDatasetSlice: StateCreator<
|
|
29
|
+
KnowledgeBaseStore,
|
|
30
|
+
[['zustand/devtools', never]],
|
|
31
|
+
[],
|
|
32
|
+
RAGEvalDatasetAction
|
|
33
|
+
> = (set, get) => ({
|
|
34
|
+
createNewDataset: async (params) => {
|
|
35
|
+
await ragEvalService.createDataset(params);
|
|
36
|
+
await get().refreshDatasetList();
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
importDataset: async (file, datasetId) => {
|
|
40
|
+
if (!datasetId) return;
|
|
41
|
+
const fileType = file.name.split('.').pop();
|
|
42
|
+
|
|
43
|
+
if (fileType === 'jsonl') {
|
|
44
|
+
// jsonl 文件 需要拆分成单个条,然后逐一校验格式
|
|
45
|
+
const jsonl = await file.text();
|
|
46
|
+
const { default: JSONL } = await import('jsonl-parse-stringify');
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const items = JSONL.parse(jsonl);
|
|
50
|
+
|
|
51
|
+
// check if the items are valid
|
|
52
|
+
insertEvalDatasetRecordSchema.array().parse(items);
|
|
53
|
+
|
|
54
|
+
// if valid, send to backend
|
|
55
|
+
await ragEvalService.importDatasetRecords(datasetId, file);
|
|
56
|
+
} catch (e) {
|
|
57
|
+
notification.error({ description: (e as Error).message, message: '文件格式错误' });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
await get().refreshDatasetList();
|
|
62
|
+
},
|
|
63
|
+
refreshDatasetList: async () => {
|
|
64
|
+
await mutate(FETCH_DATASET_LIST_KEY);
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
removeDataset: async (id) => {
|
|
68
|
+
await ragEvalService.removeDataset(id);
|
|
69
|
+
await get().refreshDatasetList();
|
|
70
|
+
},
|
|
71
|
+
useFetchDatasetRecords: (datasetId) =>
|
|
72
|
+
useClientDataSWR<EvalDatasetRecord[]>(
|
|
73
|
+
!!datasetId ? [FETCH_DATASET_RECORD_KEY, datasetId] : null,
|
|
74
|
+
() => ragEvalService.getDatasetRecords(datasetId!),
|
|
75
|
+
),
|
|
76
|
+
useFetchDatasets: (knowledgeBaseId) =>
|
|
77
|
+
useClientDataSWR<RAGEvalDataSetItem[]>(
|
|
78
|
+
[FETCH_DATASET_LIST_KEY, knowledgeBaseId],
|
|
79
|
+
() => ragEvalService.getDatasets(knowledgeBaseId),
|
|
80
|
+
{
|
|
81
|
+
fallbackData: [],
|
|
82
|
+
onSuccess: () => {
|
|
83
|
+
if (!get().initDatasetList)
|
|
84
|
+
set({ initDatasetList: true }, false, 'useFetchDatasets/init');
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
),
|
|
88
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { SWRResponse, mutate } from 'swr';
|
|
2
|
+
import { StateCreator } from 'zustand/vanilla';
|
|
3
|
+
|
|
4
|
+
import { useClientDataSWR } from '@/libs/swr';
|
|
5
|
+
import { ragEvalService } from '@/services/ragEval';
|
|
6
|
+
import { KnowledgeBaseStore } from '@/store/knowledgeBase/store';
|
|
7
|
+
import { CreateNewEvalEvaluation, RAGEvalDataSetItem } from '@/types/eval';
|
|
8
|
+
|
|
9
|
+
const FETCH_EVALUATION_LIST_KEY = 'FETCH_EVALUATION_LIST_KEY';
|
|
10
|
+
|
|
11
|
+
export interface RAGEvalEvaluationAction {
|
|
12
|
+
checkEvaluationStatus: (id: number) => Promise<void>;
|
|
13
|
+
|
|
14
|
+
createNewEvaluation: (params: CreateNewEvalEvaluation) => Promise<void>;
|
|
15
|
+
refreshEvaluationList: () => Promise<void>;
|
|
16
|
+
|
|
17
|
+
removeEvaluation: (id: number) => Promise<void>;
|
|
18
|
+
runEvaluation: (id: number) => Promise<void>;
|
|
19
|
+
|
|
20
|
+
useFetchEvaluationList: (knowledgeBaseId: string) => SWRResponse<RAGEvalDataSetItem[]>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const createRagEvalEvaluationSlice: StateCreator<
|
|
24
|
+
KnowledgeBaseStore,
|
|
25
|
+
[['zustand/devtools', never]],
|
|
26
|
+
[],
|
|
27
|
+
RAGEvalEvaluationAction
|
|
28
|
+
> = (set, get) => ({
|
|
29
|
+
checkEvaluationStatus: async (id) => {
|
|
30
|
+
await ragEvalService.checkEvaluationStatus(id);
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
createNewEvaluation: async (params) => {
|
|
34
|
+
await ragEvalService.createEvaluation(params);
|
|
35
|
+
await get().refreshEvaluationList();
|
|
36
|
+
},
|
|
37
|
+
refreshEvaluationList: async () => {
|
|
38
|
+
await mutate(FETCH_EVALUATION_LIST_KEY);
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
removeEvaluation: async (id) => {
|
|
42
|
+
await ragEvalService.removeEvaluation(id);
|
|
43
|
+
// await get().refreshEvaluationList();
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
runEvaluation: async (id) => {
|
|
47
|
+
await ragEvalService.startEvaluationTask(id);
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
useFetchEvaluationList: (knowledgeBaseId) =>
|
|
51
|
+
useClientDataSWR<RAGEvalDataSetItem[]>(
|
|
52
|
+
[FETCH_EVALUATION_LIST_KEY, knowledgeBaseId],
|
|
53
|
+
() => ragEvalService.getEvaluationList(knowledgeBaseId),
|
|
54
|
+
{
|
|
55
|
+
fallbackData: [],
|
|
56
|
+
onSuccess: () => {
|
|
57
|
+
if (!get().initDatasetList)
|
|
58
|
+
set({ initDatasetList: true }, false, 'useFetchDatasets/init');
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
),
|
|
62
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StateCreator } from 'zustand/vanilla';
|
|
2
|
+
|
|
3
|
+
import { KnowledgeBaseStore } from '@/store/knowledgeBase/store';
|
|
4
|
+
|
|
5
|
+
import { RAGEvalDatasetAction, createRagEvalDatasetSlice } from './dataset';
|
|
6
|
+
import { RAGEvalEvaluationAction, createRagEvalEvaluationSlice } from './evaluation';
|
|
7
|
+
|
|
8
|
+
export interface RAGEvalAction extends RAGEvalDatasetAction, RAGEvalEvaluationAction {
|
|
9
|
+
// empty
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const createRagEvalSlice: StateCreator<
|
|
13
|
+
KnowledgeBaseStore,
|
|
14
|
+
[['zustand/devtools', never]],
|
|
15
|
+
[],
|
|
16
|
+
RAGEvalAction
|
|
17
|
+
> = (...params) => ({
|
|
18
|
+
...createRagEvalDatasetSlice(...params),
|
|
19
|
+
...createRagEvalEvaluationSlice(...params),
|
|
20
|
+
});
|
|
@@ -6,12 +6,17 @@ import { createDevtools } from '../middleware/createDevtools';
|
|
|
6
6
|
import { KnowledgeBaseStoreState, initialState } from './initialState';
|
|
7
7
|
import { KnowledgeBaseContentAction, createContentSlice } from './slices/content';
|
|
8
8
|
import { KnowledgeBaseCrudAction, createCrudSlice } from './slices/crud';
|
|
9
|
+
import { RAGEvalAction, createRagEvalSlice } from './slices/ragEval';
|
|
9
10
|
|
|
10
11
|
// =============== 聚合 createStoreFn ============ //
|
|
11
12
|
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
export interface KnowledgeBaseStore
|
|
14
|
+
extends KnowledgeBaseStoreState,
|
|
15
|
+
KnowledgeBaseCrudAction,
|
|
16
|
+
KnowledgeBaseContentAction,
|
|
17
|
+
RAGEvalAction {
|
|
18
|
+
// empty
|
|
19
|
+
}
|
|
15
20
|
|
|
16
21
|
const createStore: StateCreator<KnowledgeBaseStore, [['zustand/devtools', never]]> = (
|
|
17
22
|
...parameters
|
|
@@ -19,6 +24,7 @@ const createStore: StateCreator<KnowledgeBaseStore, [['zustand/devtools', never]
|
|
|
19
24
|
...initialState,
|
|
20
25
|
...createCrudSlice(...parameters),
|
|
21
26
|
...createContentSlice(...parameters),
|
|
27
|
+
...createRagEvalSlice(...parameters),
|
|
22
28
|
});
|
|
23
29
|
|
|
24
30
|
// =============== 实装 useStore ============ //
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export interface EvalDatasetRecordRefFile {
|
|
4
|
+
fileType: string;
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EvalDatasetRecord {
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
id: number;
|
|
11
|
+
ideal?: string | null;
|
|
12
|
+
|
|
13
|
+
metadata: any;
|
|
14
|
+
|
|
15
|
+
question?: string | null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The reference files for the question
|
|
19
|
+
*/
|
|
20
|
+
referenceFiles?: EvalDatasetRecordRefFile[] | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const insertEvalDatasetRecordSchema = z.object({
|
|
24
|
+
ideal: z.string().optional(),
|
|
25
|
+
|
|
26
|
+
question: z.string(),
|
|
27
|
+
|
|
28
|
+
referenceFiles: z.string().or(z.array(z.string())).optional(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export type InsertEvalDatasetRecord = z.infer<typeof insertEvalDatasetRecordSchema>;
|
|
32
|
+
|
|
33
|
+
export interface RAGEvalDataSetItem {
|
|
34
|
+
createdAt: Date;
|
|
35
|
+
description?: string | null;
|
|
36
|
+
id: number;
|
|
37
|
+
name: string;
|
|
38
|
+
updatedAt: Date;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const insertEvalDatasetsSchema = z.object({
|
|
42
|
+
description: z.string().optional(),
|
|
43
|
+
knowledgeBaseId: z.string(),
|
|
44
|
+
name: z.string(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export type CreateNewEvalDatasets = z.infer<typeof insertEvalDatasetsSchema>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export enum EvalEvaluationStatus {
|
|
4
|
+
Error = 'Error',
|
|
5
|
+
Pending = 'Pending',
|
|
6
|
+
Processing = 'Processing',
|
|
7
|
+
Success = 'Success',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface EvaluationRecord {
|
|
11
|
+
answer: string;
|
|
12
|
+
context: string[];
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
id: number;
|
|
15
|
+
ideal: string;
|
|
16
|
+
question: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const insertEvaluationSchema = z.object({
|
|
20
|
+
ideal: z.string().optional(),
|
|
21
|
+
|
|
22
|
+
question: z.string(),
|
|
23
|
+
|
|
24
|
+
referenceFiles: z.string().or(z.array(z.string())).optional(),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type InsertEvaluationRecord = z.infer<typeof insertEvaluationSchema>;
|
|
28
|
+
|
|
29
|
+
export interface RAGEvalEvaluationItem {
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
dataset: {
|
|
32
|
+
id: number;
|
|
33
|
+
name: string;
|
|
34
|
+
};
|
|
35
|
+
evalRecordsUrl?: string;
|
|
36
|
+
id: number;
|
|
37
|
+
name: string;
|
|
38
|
+
recordsStats: {
|
|
39
|
+
success: number;
|
|
40
|
+
total: number;
|
|
41
|
+
};
|
|
42
|
+
status: EvalEvaluationStatus;
|
|
43
|
+
updatedAt: Date;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const insertEvalEvaluationSchema = z.object({
|
|
47
|
+
datasetId: z.number(),
|
|
48
|
+
description: z.string().optional(),
|
|
49
|
+
knowledgeBaseId: z.string(),
|
|
50
|
+
name: z.string(),
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export type CreateNewEvalEvaluation = z.infer<typeof insertEvalEvaluationSchema>;
|