Initial commit

This commit is contained in:
ItzCrazyKns
2024-04-09 16:21:05 +05:30
commit d1c74c861e
57 changed files with 4568 additions and 0 deletions

View File

@ -0,0 +1,9 @@
import { BaseMessage } from '@langchain/core/messages';
const formatChatHistoryAsString = (history: BaseMessage[]) => {
return history
.map((message) => `${message._getType()}: ${message.content}`)
.join('\n');
};
export default formatChatHistoryAsString;