Familiarity with Weaviate x OpenAI?

Does anyone here have familiarity with Weaviate and nextjs? If so, did you experience a CORS error when using the OpenAI API key for text2vec?

1 Like

I’m interested as well

2 Likes

The connection to OpenAI goes via Weaviate itself client <> Weaviate <> OpenAI. So the CORS issue should not be related to setting the OpenAI key.

To validate this, can you please run the following Weaviate client code (this code doesn’t send any requests to the OpenAI endpoint)?

const weaviate = require("weaviate-client");

const client = weaviate.client({
  scheme: 'http',
  host: 'localhost:8080' // <== set to your host and port
});

client
  .schema
  .getter()
  .do()
  .then(res => {
    console.log(res);
  })
  .catch(err => {
    console.error(err)
  });
1 Like

Thanks for the reply!

I spoke with one of the engineers at Weaviate and they’re looking into their config. It’s possible they set it up such that custom headers were blocked.

I tried your code out though for my query (as that was where the issue lied) – upon completing a query, an object with key “classes” with an empty array value was returned. Was that the intended outcome?

Thanks for the reply!

NP :slight_smile:

I spoke with one of the engineers at Weaviate and they’re looking into their config. It’s possible they set it up such that custom headers were blocked.

Great – would be awesome if you can share the outcome here as well for those who might encounter something similar with the JS client.

I tried your code out though for my query (as that was where the issue lied) – upon completing a query, an object with key “classes” with an empty array value was returned. Was that the intended outcome?

Yes, that’s correct. This means that Weaviate is not a CORS blocker. If you have classes added, you will see them there (instead of the empty array)

1 Like

For sure, I’ll keep this thread posted with any updates from the team.

Yeah, I was using custom headers (OpenAI headers) when doing querying and it looks like for headers, CORS preflight blocked it