|
1 | | -import { StatusCodes } from 'http-status-codes' |
2 | 1 | import { EvaluationRunner, ICommonObject } from 'flowise-components' |
3 | | -import { getRunningExpressApp } from '../../utils/getRunningExpressApp' |
4 | | -import { InternalFlowiseError } from '../../errors/internalFlowiseError' |
5 | | -import { getErrorMessage } from '../../errors/utils' |
| 2 | +import { StatusCodes } from 'http-status-codes' |
| 3 | +import { In } from 'typeorm' |
| 4 | +import { v4 as uuidv4 } from 'uuid' |
| 5 | +import { ApiKey } from '../../database/entities/ApiKey' |
| 6 | +import { Assistant } from '../../database/entities/Assistant' |
| 7 | +import { ChatFlow } from '../../database/entities/ChatFlow' |
| 8 | +import { Credential } from '../../database/entities/Credential' |
6 | 9 | import { Dataset } from '../../database/entities/Dataset' |
7 | 10 | import { DatasetRow } from '../../database/entities/DatasetRow' |
8 | 11 | import { Evaluation } from '../../database/entities/Evaluation' |
9 | | -import { EvaluationStatus, IEvaluationResult } from '../../Interface' |
10 | 12 | import { EvaluationRun } from '../../database/entities/EvaluationRun' |
11 | | -import { Credential } from '../../database/entities/Credential' |
12 | | -import { ApiKey } from '../../database/entities/ApiKey' |
13 | | -import { ChatFlow } from '../../database/entities/ChatFlow' |
14 | | -import { getAppVersion } from '../../utils' |
15 | | -import { In } from 'typeorm' |
16 | 13 | import { getWorkspaceSearchOptions } from '../../enterprise/utils/ControllerServiceUtils' |
17 | | -import { v4 as uuidv4 } from 'uuid' |
| 14 | +import { InternalFlowiseError } from '../../errors/internalFlowiseError' |
| 15 | +import { getErrorMessage } from '../../errors/utils' |
| 16 | +import { EvaluationStatus, IEvaluationResult } from '../../Interface' |
| 17 | +import { getAppVersion } from '../../utils' |
| 18 | +import { getRunningExpressApp } from '../../utils/getRunningExpressApp' |
| 19 | +import { stripProtectedFields } from '../../utils/stripProtectedFields' |
| 20 | +import evaluatorsService from '../evaluator' |
18 | 21 | import { calculateCost, formatCost } from './CostCalculator' |
19 | 22 | import { runAdditionalEvaluators } from './EvaluatorRunner' |
20 | | -import evaluatorsService from '../evaluator' |
21 | 23 | import { LLMEvaluationRunner } from './LLMEvaluationRunner' |
22 | | -import { Assistant } from '../../database/entities/Assistant' |
23 | 24 |
|
24 | 25 | const runAgain = async (id: string, baseURL: string, orgId: string, workspaceId: string) => { |
25 | 26 | try { |
@@ -66,7 +67,8 @@ const createEvaluation = async (body: ICommonObject, baseURL: string, orgId: str |
66 | 67 | try { |
67 | 68 | const appServer = getRunningExpressApp() |
68 | 69 | const newEval = new Evaluation() |
69 | | - Object.assign(newEval, body) |
| 70 | + Object.assign(newEval, stripProtectedFields(body)) |
| 71 | + newEval.workspaceId = workspaceId |
70 | 72 | newEval.status = EvaluationStatus.PENDING |
71 | 73 |
|
72 | 74 | const row = appServer.AppDataSource.getRepository(Evaluation).create(newEval) |
|
0 commit comments