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

Problem with using Namespaces #84

Open
kaanguneyli opened this issue Oct 3, 2024 · 3 comments
Open

Problem with using Namespaces #84

kaanguneyli opened this issue Oct 3, 2024 · 3 comments

Comments

@kaanguneyli
Copy link

I am trying to create a chatbot using Next.js and Javascript. I firstly upload some context to a namespace in my Vector database. Then, when I try to ask questions, I receive an answer which indicates that I have provided no previous context. the program work correctly when I remove the namespace property.
Below is the code snippets I use for adding context and chatting.

await ragChat.context.add({
type: 'text',
data: chunk,
options: { namespace: namespace },
});

const reply = await ragChat.chat(
query, {
options: {namespace: namespace}
,},);

@ytkimirti
Copy link
Contributor

I checked the code and everything seems to be ok. You might want to wait for the db to finish indexing first which takes a few seconds sometimes.

You can check from the vector databrowser the namespace is empty or not. Also you can use debug: true when creating the RAGChat, it can help when debugging.

@kaanguneyli
Copy link
Author

I was already checking the data browser in my previous trials and it was filled with the correct data each time. However, while chatting I cannot get answers related to the context I have uploaded

@ronal2do
Copy link
Contributor

Looks like the way that you are using, maybe the API needs a bit of adjustment as well but on your case you need to pass the namespace outside of options
reference

namespace?: string;

  const response = await ragChat.chat(lastMessage, {
    namespace: namespace,
    metadata: {
      sessionId,
    }
  });
  

the options namespace you can use I believe only to train the data

await ragChat.context.add({
type: 'text',
data: chunk,
options: { namespace: namespace },
});

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

3 participants