Is the error happens due to openai api key or is there a way to prevent input check?

Creating vector store…
Error: usage error (422): {“error”:[{“message”:“class name “Document” already exists”}]}
at file:///mnt/c/Users/user/Downloads/Projects_Hack/Chat-i-nette/App/node_modules/weaviate-ts-client/dist/index.mjs:1:7218
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at run (/mnt/c/Users/user/Downloads/Projects_Hack/Chat-i-nette/App/ingest.ts:116:5)

Hi @mdabir1203

That error looks like you are trying to create a class called “Document” while one already exists. I would check the code to skip that step if a class exists.


Thank you very much for the reply. We looked into the class Document. We wrote our own sanitization still it didn’t work !_!

Hi @mdabir1203 !

Check out this recipe for hybrid seach using Open AI:

On this example this error is likely to happen if you skip the code:

# resetting the schema. CAUTION: THIS WILL DELETE YOUR DATA 

if you want to incrementally ingest content into your Class, you will need to create the class only once.


let me know if that helps :slight_smile:

Hi @mdabir1203 - are you using an external integration like LangChain ?

Yes. We used langchain Js

Gotcha. The Weaviate error class name “Document” already exists occurs when a request to create a class is sent while one exists already.

So, something is happening where LangChain is trying to create a class while one already exists. I don’t know enough about LangChain to say where this is happening, exactly.

You might be able to configure something in LangChain to prevent this from happening, or if you don’t need the data in it you might be able to delete the class manually and go from there.

(This is how you would delete a class. Note this is through the Weaviate library, not LangChain.)