Lunary: feedback tracking (#3332)

* Lunary: feedback tracking

* fix incorrect param order
This commit is contained in:
Vincelwt
2024-10-21 18:32:51 +08:00
committed by GitHub
parent 2c6cf12d2c
commit 4a9ffe7b99
8 changed files with 80 additions and 36 deletions
+4 -1
View File
@@ -23,7 +23,7 @@ import { UpsertHistory } from '../database/entities/UpsertHistory'
import { InternalFlowiseError } from '../errors/internalFlowiseError'
import { StatusCodes } from 'http-status-codes'
import { getErrorMessage } from '../errors/utils'
import { v4 as uuidv4 } from 'uuid'
/**
* Upsert documents
* @param {Request} req
@@ -108,6 +108,8 @@ export const upsertVector = async (req: Request, isInternal: boolean = false) =>
const nodes = parsedFlowData.nodes
const edges = parsedFlowData.edges
const apiMessageId = req.body.apiMessageId ?? uuidv4()
let stopNodeId = incomingInput?.stopNodeId ?? ''
let chatHistory: IMessage[] = []
let chatId = incomingInput.chatId ?? ''
@@ -162,6 +164,7 @@ export const upsertVector = async (req: Request, isInternal: boolean = false) =>
question: incomingInput.question,
chatHistory,
chatId,
apiMessageId,
sessionId: sessionId ?? '',
chatflowid,
appDataSource: appServer.AppDataSource,