mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +03:00
fix chat history
This commit is contained in:
@@ -549,6 +549,18 @@ export const convertChatHistoryToText = (chatHistory: IMessage[] = []): string =
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize array chat history to string
|
||||
* @param {IMessage[]} chatHistory
|
||||
* @returns {string}
|
||||
*/
|
||||
export const serializeChatHistory = (chatHistory: string | Array<string>) => {
|
||||
if (Array.isArray(chatHistory)) {
|
||||
return chatHistory.join('\n')
|
||||
}
|
||||
return chatHistory
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert schema to zod schema
|
||||
* @param {string | object} schema
|
||||
|
||||
Reference in New Issue
Block a user