Issue with Base URL and API Version when using AzureOpenAI #862

When using Azure OpenAI through Private Org BaseURL, the following error occurs

ValueError: Error during query: [{'locations': [{'column': 6, 'line': 1}], 'message': 'explorer: get class: vectorize params: vectorize params: vectorize params: vectorize keywords: remote client vectorize: send POST request: Post "": read tcp> read: connection reset by peer', 'path': ['Get', 'OAAIndexOpenAITest']}]

The program is sending request to even after specifying the X-OpenAI-BaseURL". Instead of routing to https://<baseURL>/openai/deployments/<deploymentID>/chat/completions?api-version=<api-version>

This is occurring when retrieving the indexed documents from Weaviate.

import weaviate

auth_client_secret = weaviate.AuthApiKey(Config.WEAVIATE_READER_APIKEY)
additional_headers = {"X-Azure-Api-Key": Config.OPENAI_API_KEY,
wv_conn = weaviate.Client(url=os.environ["WEAVIATE_URL"],

The index is created using create_class

vectorizer = "text2vec-openai"
module_config = {vectorizer: {"resourceName": Config.OPENAI_RESOURCE_NAME,
                                                    "baseURL" : Config.OPENAI_API_BASE,
                                                    "deploymentId": Constants.OPENAI_DEPLOYMENT}}
wv_conn.schema.create_class({"class": "temp_class",
                                                      "vectorizer": vectorizer ,
                                                       "moduleConfig": module_config})

These updates are made in weaviate repo, see below PRs. Aren’t these supposed to be reflected here too?

Version: 4.4.2
Summary: A python native Weaviate client
Author: Weaviate
License: BSD 3-clause
Location: /Users/vedala/Documents/projects/OA/oa-answers/oaa/lib/python3.9/site-packages
Requires: authlib, grpcio, grpcio-health-checking, grpcio-tools, httpx, pydantic, requests, validators```

Hi @pi_crust !

What is the server and client version?

Can you reproduce this on latest version of both Weaviate and the python client (4.X?)