All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.langchain4j.chroma.runtime.ChromaRecorder Maven / Gradle / Ivy

There is a newer version: 0.21.0
Show newest version
package io.quarkiverse.langchain4j.chroma.runtime;

import java.time.Duration;
import java.util.function.Supplier;

import io.quarkiverse.langchain4j.chroma.ChromaEmbeddingStore;
import io.quarkus.runtime.annotations.Recorder;

@Recorder
public class ChromaRecorder {
    public Supplier chromaStoreSupplier(ChromaConfig config) {
        return new Supplier<>() {
            @Override
            public ChromaEmbeddingStore get() {
                return new ChromaEmbeddingStore(config.url(),
                        config.collectionName(),
                        config.timeout().orElse(Duration.ofSeconds(5)),
                        config.logRequests().orElse(false),
                        config.logResponses().orElse(false));
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy