Help with Custom GPT ↔ Weaviate Cloud Integration (HTTP 400 Error)

Description

Hello everyone,
I am currently working on connecting my custom GPT to Weaviate Cloud in order to retrieve contextual content. However, I consistently encounter an HTTP 400 Bad Request error when calling my weaviate collection.
From what I understand, the issue seems related to the plugin request syntax. I have reviewed the available examples, but unfortunately, I am still unable to make it work.
If anyone could kindly share a working syntax example (or point me to relevant documentation), it would be greatly appreciated.
Thank you in advance for your support!

Server Setup Information

  • Weaviate Server Version:
  • Deployment Method:
  • Multi Node? Number of Running Nodes:
  • Client Language and Version:
  • Multitenancy?:

Any additional Information

hi @Will78 !!

Welcome to our community :hugs:

You can do that by providing a generative provider at query time and point it’s baseurl elsewhere you can answer the request with your custom GPT/Generative model

For example:

from weaviate import classes as wvc

collection = client.collections.create(
    "Test",
)
collection.data.insert({"title": "Something to test"})

collection.generate.bm25(
    query="Some Test",
    generative_provider=wvc.generate.GenerativeConfig.openai(
        base_url="https://webhook.site/432cd01d-f8e1-418f-81d0-c172d19bc646"
    ),
    grouped_task="Translate to Portuguese",
)

and this is the payload you will get sent to https://webhook.site/432cd01d-f8e1-418f-81d0-c172d19bc646

{
  "messages": [
    {
      "role": "user",
      "content": "Translate to Portuguese: [{\"title\":\"Something to test\"}]"
    }
  ],
  "model": "gpt-5-mini",
  "frequency_penalty": 0,
  "max_completion_tokens": 127980,
  "presence_penalty": 0,
  "top_p": 1
}

Ps: Using here generate.bm25 for the sake of simplicity, but it will work with all different search methods.

Let me know if this helps!