quarkiverse / quarkus-langchain4j

Quarkus Langchain4j extension
https://docs.quarkiverse.io/quarkus-langchain4j/dev/index.html
Apache License 2.0
119 stars 65 forks source link

Allow multi-deployment configuration for Azure OpenAI #598

Closed csotiriou closed 1 month ago

csotiriou commented 1 month ago

Relevant to #237, this will allow overriding the following properties per model in the Azure OpenAI configuration

Example configuration that is now possible:

quarkus.langchain4j.azure-openai.ad-token=token
quarkus.langchain4j.azure-openai.api-version=2023-07-01-preview
quarkus.langchain4j.azure-openai.chat-model.enabled=true
quarkus.langchain4j.azure-openai.deployment-name=my-deployment-name
quarkus.langchain4j.azure-openai.embedding-model.enabled=true
quarkus.langchain4j.azure-openai.resource-name=name
quarkus.langchain4j.azure-openai.embedding-model.deployment-name=another-deployment-name

In the above example, all models in the parent configuration will have the my-deployment-name, but the Embedding model will have the another-deployment-name specifically as a name.

csotiriou commented 1 month ago

@geoand I removed the lamdas in favor of Suppliers I hope that's ok (I saw that there were other cases with Suppliers as well. I also made the PR ready for review, as I have tested it and it seems to be working.

I suppose the reason for the change is performance?

geoand commented 1 month ago

Yeah, at some point in the past we saw there was a tiny impact related to lambdas so we decided to try and limit their use in our code

csotiriou commented 1 month ago

Ah, yes. done.

geoand commented 1 month ago

I force pushed an update that fixes the formatter complaints