Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent all chats to share one history. #103

Open
alexomon018 opened this issue Feb 21, 2025 · 0 comments
Open

Prevent all chats to share one history. #103

alexomon018 opened this issue Feb 21, 2025 · 0 comments

Comments

@alexomon018
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant