feat: unique chat id

This commit is contained in:
Jeffrey-Wang
2023-06-11 13:14:53 +08:00
parent 011f6afcb3
commit 023967e0c2
5 changed files with 19 additions and 11 deletions
+2 -1
View File
@@ -182,6 +182,7 @@ export const buildLangchain = async (
depthQueue: IDepthQueue,
componentNodes: IComponentNodes,
question: string,
chatId: string,
overrideConfig?: ICommonObject
) => {
const flowNodes = cloneDeep(reactFlowNodes)
@@ -214,7 +215,7 @@ export const buildLangchain = async (
if (overrideConfig) flowNodeData = replaceInputsWithConfig(flowNodeData, overrideConfig)
const reactFlowNodeData: INodeData = resolveVariables(flowNodeData, flowNodes, question)
flowNodes[nodeIndex].data.instance = await newNodeInstance.init(reactFlowNodeData, question)
flowNodes[nodeIndex].data.instance = await newNodeInstance.init(reactFlowNodeData, question, { chatId })
} catch (e: any) {
console.error(e)
throw new Error(e)