Perplexica / src /utils /formatHistory.ts
Asman2010's picture
Upload 65 files
f5ed9bf verified
raw
history blame contribute delete
277 Bytes
import { BaseMessage } from '@langchain/core/messages';
const formatChatHistoryAsString = (history: BaseMessage[]) => {
return history
.map((message) => `${message._getType()}: ${message.content}`)
.join('\n');
};
export default formatChatHistoryAsString;