Skip to content

Commit

Permalink
Merge pull request #1135 from jmartisk/main-issue-1129
Browse files Browse the repository at this point in the history
Fix registration of embedding model for Easy RAG
  • Loading branch information
geoand authored Dec 3, 2024
2 parents bb5c722 + ddda5fa commit 2e8615a
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 2e8615a

Please sign in to comment.