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

Azure OpenAI auth - not possible to specify api-key for (default)embedding-model #1154

Open
flyinfish opened this issue Dec 12, 2024 · 8 comments · May be fixed by #1177
Open

Azure OpenAI auth - not possible to specify api-key for (default)embedding-model #1154

flyinfish opened this issue Dec 12, 2024 · 8 comments · May be fixed by #1177
Labels
area/model bug Something isn't working

Comments

@flyinfish
Copy link

flyinfish commented Dec 12, 2024

BUG

when using an embedding model it is possible to specify a dedicated endpoint, but not a dedicated api-key

quarkus.langchain4j.azure-openai.embedding-model.resource-name=...
quarkus.langchain4j.azure-openai.embedding-model.api-key=unfortunately-ignored

when using ad different resource-name as in quarkus.langchain4j.azure-openai there will be a different api-key needed as well. but for api-key it falls back to quarkus.langchain4j.azure-openai or refusing to start if not present:


        SRCFG00014: Exactly of the configuration properties must be present: quarkus.langchain4j.azure-openai.api-key or quarkus.langchain4j.azure-openai.ad-token        

Expected Behaviour

should be possible to specify

quarkus.langchain4j.azure-openai.embedding-model.api-key=...

Workaround

the workaround for some cases might be using a @ModelName this works as expected

quarkus.langchain4j.azure-openai.<namedembeddingmodel>.resource-name=...
quarkus.langchain4j.azure-openai.<namedembeddingmodel>.api-key=...

Reproduce

<quarkus-langchain4j.version>0.22.0</quarkus-langchain4j.version>
https://github.com/flyinfish/quarkus-langchain4j--samples-azure-openai/tree/use-separate-resource-name/chatbot
https://github.com/flyinfish/quarkus-langchain4j--samples-azure-openai/blob/use-separate-resource-name/chatbot/.env-template

@geoand
Copy link
Collaborator

geoand commented Dec 13, 2024

Thanks for reporting.

The same issue exists for the chat model too, right?

@geoand geoand added bug Something isn't working area/model labels Dec 16, 2024
@flyinfish
Copy link
Author

The same issue exists for the chat model too, right?

Yes!
Thanks

@geoand
Copy link
Collaborator

geoand commented Dec 17, 2024

@edeandrea WDYT?

@edeandrea
Copy link
Collaborator

Sounds reasonable. If you're looking for me to take this up I don't think I'm going to have the bandwidth for a bit.

@geoand
Copy link
Collaborator

geoand commented Dec 19, 2024

👍🏽

@geoand
Copy link
Collaborator

geoand commented Dec 19, 2024

@flyinfish would you be interested in contributing this?

@flyinfish
Copy link
Author

Can give a shot

@geoand
Copy link
Collaborator

geoand commented Dec 20, 2024

👌

flyinfish pushed a commit to flyinfish/quarkus-langchain4j that referenced this issue Dec 20, 2024
for chat-, embedding-, and image-model: api-key, ad-token, api-version

Closes quarkiverse#1154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/model bug Something isn't working
Projects
None yet
3 participants