Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X-Azure-Api-Key doesn't work in headers. Asking openai api key instead. while calling withNearText search. #4649

Open
1 task done
mihir-kanzariya opened this issue Apr 11, 2024 · 4 comments
Labels

Comments

@mihir-kanzariya
Copy link

mihir-kanzariya commented Apr 11, 2024

How to reproduce this bug?

I am using azure openai, i created class and client .

const client = weaviate.client({ scheme: 'https', host: 'XXXXX-vv0royyl.weaviate.network', headers: { "X-Azure-Api-Key": PROCESS.ENV.AZURE_OPENAI_KEY } });

I get below error while calling Below function

Function: result = await client.graphql .get() .withClassName(model) .withNearText({ concepts: [question], targetVectors: ['content'], }) .withWhere({ path: ['trainingDataType'], operator: 'Equal', valueText: trainingDataType, }) .withLimit(limit) .withFields('content _additional { distance }') .do();

Error
{ "response": { "data": { "Get": { "Custcity": null } }, "errors": [ { "locations": [ { "column": 6, "line": 1 } ], "message": "explorer: get class: vectorize params: vectorize params: vectorize params: vectorize keywords: remote client vectorize: API Key: no api key found neither in request header: X-Openai-Api-Key nor in environment variable under OPENAI_APIKEY", "path": [ "Get", "Custcity" ] } ], "status": 200, "headers": {} }, "request": { "query": "{Get{Custcity(where:{operator:Equal,valueText:\"SCHEMA\",path:[\"trainingDataType\"]},nearText:{concepts:[\"Analyze the correlation between the number of activities (tasks and events) and opportunity win rates.\"],targetVectors:[\"content\"]},limit:8){content _additional { distance }}}}" } }

What is the expected behavior?

It should consider azure open ai key

What is the actual behavior?

It is not working with azure openai key

Slack conversation about issue: https://weaviate.slack.com/archives/C02RRQP23K3/p1712830332189929

Supporting information

No response

Server Version

1.24.8

Code of Conduct

@mihir-kanzariya mihir-kanzariya changed the title X-Azure-Api-Key doesn't work in headers. Asking openai api key instead. X-Azure-Api-Key doesn't work in headers. Asking openai api key instead. while calling withNearText search. Apr 11, 2024
@andrewisplinghoff
Copy link

Probably not related to the actual problem, but I do not think that you can pass baseURL, deploymentId and resourceName as query parameters: https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-openai#query-time-parameters

These settings related to Azure OpenAI are configured on the collection level:
https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-openai#api-settings-azure-openai

@mihir-kanzariya
Copy link
Author

in any case, it didn't work, I tried many combinations. Please follow slack conversation for better understanding of issue.

I guess there is a bug.

@rg1918
Copy link

rg1918 commented May 10, 2024

Is there any update on this ?

@antas-marcin
Copy link
Contributor

@mihir-kanzariya I think that I know why are you getting this error. I don't know how your class is configured but it looks like that Weaviate doesn't recognize it that it's an Azure configuration, did you define resourceName and deploymentId in your classes config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants