MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / createEvaluator

Function createEvaluator

packages/server/src/services/evaluator/index.ts:52–67  ·  view source on GitHub ↗
(body: any)

Source from the content-addressed store, hash-verified

50
51// Create new Evaluator
52const createEvaluator = async (body: any) => {
53 try {
54 const appServer = getRunningExpressApp()
55 const newDs = EvaluatorDTO.toEntity(body)
56 newDs.workspaceId = body.workspaceId
57
58 const evaluator = appServer.AppDataSource.getRepository(Evaluator).create(newDs)
59 const result = await appServer.AppDataSource.getRepository(Evaluator).save(evaluator)
60 return EvaluatorDTO.fromEntity(result)
61 } catch (error) {
62 throw new InternalFlowiseError(
63 StatusCodes.INTERNAL_SERVER_ERROR,
64 `Error: evaluatorService.createEvaluator - ${getErrorMessage(error)}`
65 )
66 }
67}
68
69// Update Evaluator
70const updateEvaluator = async (id: string, body: any, workspaceId: string) => {

Callers

nothing calls this directly

Calls 5

getRunningExpressAppFunction · 0.90
getErrorMessageFunction · 0.90
toEntityMethod · 0.45
createMethod · 0.45
fromEntityMethod · 0.45

Tested by

no test coverage detected