Hey guys,
First off, amazing work on the library/ I've been using it for quite a while in my chat app, and it's been great!
I recently noticed that all chats seem to be sharing the same history when using the following setup:
const getCurrentTime = () => new Date().toLocaleString();
const ragChat = new RAGChat({
ratelimit,
debug: true,
model: openai("gpt-4o-mini", {
organization: process.env.OPENAI_ORGANIZATION,
}),
vector: new Index({
url: process.env.UPSTASH_VECTOR_REST_URL,
token: process.env.UPSTASH_VECTOR_REST_TOKEN,
}),
redis,
promptFn: ({ question, chatHistory, context }) => `
---
chat history:
${chatHistory}
---
context:
${context}
---
question:
${question}
`
});
I came across the sessionId option and was considering using it to differentiate between chats. Would that be the recommended approach, or is there a better way to handle this?
Thanks in advance!
Hey guys,
First off, amazing work on the library/ I've been using it for quite a while in my chat app, and it's been great!
I recently noticed that all chats seem to be sharing the same history when using the following setup:
I came across the
sessionIdoption and was considering using it to differentiate between chats. Would that be the recommended approach, or is there a better way to handle this?Thanks in advance!