Skip to content

Commit

Permalink
Don't register an embedding model for Easy RAG if the user explicitly…
Browse files Browse the repository at this point in the history
… chose a provider
  • Loading branch information
jmartisk committed Dec 3, 2024
1 parent bb5c722 commit ddda5fa
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,14 @@ public void handleProviders(BeanDiscoveryFinishedBuildItem beanDiscoveryFinished
// in case multiple embedding model providers are available,
// the user has to specify `quarkus.langchain4j.embedding-model.provider` to choose one
Optional<String> userSelectedProvider = buildConfig.defaultConfig().embeddingModel().provider();
String provider = selectEmbeddingModelProvider(inProcessEmbeddingBuildItems, embeddingCandidateItems,
beanDiscoveryFinished.beanStream().withBeanType(EmbeddingModel.class),
userSelectedProvider, embeddingModelBeanType, embeddingModelConfigNamespace);
selectedEmbeddingProducer
.produce(new SelectedEmbeddingModelCandidateBuildItem(provider, NamedConfigUtil.DEFAULT_NAME));
if (userSelectedProvider.isEmpty()) {
String provider = selectEmbeddingModelProvider(inProcessEmbeddingBuildItems, embeddingCandidateItems,
beanDiscoveryFinished.beanStream().withBeanType(EmbeddingModel.class),
userSelectedProvider, embeddingModelBeanType, embeddingModelConfigNamespace);
selectedEmbeddingProducer
.produce(new SelectedEmbeddingModelCandidateBuildItem(provider, NamedConfigUtil.DEFAULT_NAME));
}
// else: if the user actually selected a provider, the model will be registered automatically below anyway
}

for (String modelName : requestedModerationModels) {
Expand Down

0 comments on commit ddda5fa

Please sign in to comment.