Description
weaviate version 4.11.3
Server Setup Information
- Weaviate Server Version:
- Deployment Method: docker deployment
- Multi Node? Number of Running Nodes: 1 Node
- Client Language and Version:
- Multitenancy?: No
Any additional Information
I have set up with azure base url, resource name, deployment id and keys.
While weaviate client connecting with azure embedding service, below are the errors showing. Tried multiple trial and errors still not able to fix.
CLient: Code
def weaviate_custom_client():
try:
client = weaviate.connect_to_custom(
http_host="localhost",
http_port=8080,
http_secure=False,
grpc_host="localhost",
grpc_port=50051,
grpc_secure=False,
headers={
"X-OpenAI-Baseurl": "https://resource_name.openai.azure.com/",
"X-Azure-Api-Key": OpenAI_Api_Key,
"X-Azure-Deployment-Id": "text-embedding-ada-002",
"X-Azure-Resource-Name": "resource_name"
#"X-OpenAI-Api-Key": OpenAI_Api_Key, # Or any other inference API keys
}
)
except Exception as error:
print(error)
client.close()
return(client)
if not client.collections.exists("Article"):
bot = client.collections.create(
name="Article",
vectorizer_config=Configure.Vectorizer.text2vec_azure_openai(
base_url="https://resource_name.openai.azure.com/",
model="text-embedding-3-large",
vectorize_collection_name = False,
resource_name="resource_name",
deployment_id='text-embedding-ada-002',
),
generative_config=Configure.Generative.azure_openai(
resource_name="resource_name",
deployment_id="gpt-4o",
base_url="https://resource_name.openai.azure.com/"
),
properties=[
Property(
name="title",
data_type = DataType.TEXT,
vectorize_property_name=True
),
Property(
name="body",
data_type=DataType.TEXT,
vectorize_property_name=True
)
]
)
print("collection created")
except Exception as error:
print("Exception block called.. ")
print(error)
finally:
client.close()
del client
## Inserting data
try:
client = weaviate_custom_client()
jeopardy = client.collections.get("Article")
print("collection test:" +str(jeopardy.exists()))
uuid = jeopardy.data.insert({
"title": "A delicious Riesling",
"body": "This wine is a delicious Riesling which pairs well with seafood."
})
print("data inserted")
except Exception as er:
print(er)
finally:
client.close()
INFO:httpx:HTTP Request: POST http://localhost:8080/v1/objects “HTTP/1.1 500 Internal Server Error”
Object was not added! Unexpected status code: 500, with response body: {‘error’: [{‘message’: ‘vectorize target vector : update vector: connection to: Azure OpenAI API failed with status: 401 error: Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.’}]}