feat(ui): add necessary utils

This commit is contained in:
ItzCrazyKns
2025-03-18 10:24:16 +05:30
parent 5c313e9bed
commit e29a08dc46
5 changed files with 150 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;