Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/server/src/Interface.Evaluation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export class EvaluatorDTO {

static toEntity(body: any): Evaluator {
const newDs = new Evaluator()
Object.assign(newDs, body)
newDs.name = body.name
newDs.type = body.type
Comment thread
christopherholland-workday marked this conversation as resolved.
Outdated
let config: any = {}
if (body.type === 'llm') {
config = {
Expand Down
8 changes: 7 additions & 1 deletion packages/server/src/services/evaluations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ const createEvaluation = async (body: ICommonObject, baseURL: string, orgId: str
try {
const appServer = getRunningExpressApp()
const newEval = new Evaluation()
Object.assign(newEval, body)
Comment thread
yau-wd marked this conversation as resolved.
newEval.name = body.name
newEval.evaluationType = body.evaluationType
newEval.chatflowId = body.chatflowId
newEval.chatflowName = body.chatflowName
newEval.datasetId = body.datasetId
newEval.datasetName = body.datasetName
newEval.workspaceId = workspaceId
Comment thread
christopherholland-workday marked this conversation as resolved.
Outdated
newEval.status = EvaluationStatus.PENDING

const row = appServer.AppDataSource.getRepository(Evaluation).create(newEval)
Expand Down
2 changes: 2 additions & 0 deletions packages/server/src/services/evaluator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const createEvaluator = async (body: any) => {
try {
const appServer = getRunningExpressApp()
const newDs = EvaluatorDTO.toEntity(body)
newDs.workspaceId = body.workspaceId
Comment thread
christopherholland-workday marked this conversation as resolved.

const evaluator = appServer.AppDataSource.getRepository(Evaluator).create(newDs)
const result = await appServer.AppDataSource.getRepository(Evaluator).save(evaluator)
Expand All @@ -78,6 +79,7 @@ const updateEvaluator = async (id: string, body: any, workspaceId: string) => {

const updateEvaluator = EvaluatorDTO.toEntity(body)
updateEvaluator.id = id
updateEvaluator.workspaceId = workspaceId
Comment thread
christopherholland-workday marked this conversation as resolved.
appServer.AppDataSource.getRepository(Evaluator).merge(evaluator, updateEvaluator)
const result = await appServer.AppDataSource.getRepository(Evaluator).save(evaluator)
return EvaluatorDTO.fromEntity(result)
Expand Down
Loading