minor convert chat history to text empty array fix

This commit is contained in:
Henry
2023-10-13 16:23:50 +01:00
parent f822745e38
commit baa3d2afac
+1 -1
View File
@@ -533,7 +533,7 @@ export const mapChatHistory = (options: ICommonObject): ChatMessageHistory => {
* @param {IMessage[]} chatHistory
* @returns {string}
*/
export const convertChatHistoryToText = (chatHistory: IMessage[]): string => {
export const convertChatHistoryToText = (chatHistory: IMessage[] = []): string => {
return chatHistory
.map((chatMessage) => {
if (chatMessage.type === 'apiMessage') {