Update package.json and code files

This commit is contained in:
n4ze3m
2024-02-04 13:56:25 +05:30
parent 5958e10354
commit a66d8a8418
9 changed files with 73 additions and 36 deletions

View File

@@ -14,12 +14,13 @@ import {
RunnableMap,
RunnableSequence,
} from "langchain/schema/runnable";
import type { ChatHistory } from "~store";
type RetrievalChainInput = {
chat_history: string;
question: string;
};
export function groupMessagesByConversation(messages: any[]) {
export function groupMessagesByConversation(messages: ChatHistory) {
if (messages.length % 2 !== 0) {
messages.pop();
}