- Type Parameters:
S-E-
- All Superinterfaces:
Composable<EmbeddingGenerator<S,E>>
- All Known Subinterfaces:
EmbeddingModel<S,,E> FloatVectorEmbeddingGenerator<S>,ImageEmbeddingGenerator<E>,ImageFloatVectorEmbeddingModel,ImageNarrator,Narrator<S>,TextEmbeddingGenerator<E>,TextFloatVectorEmbeddingModel,VectorEmbeddingGenerator<S,E>
- All Known Implementing Classes:
BagOfWordsGenerator,ByteArrayImageMetadataNarrator,CachingEmbeddingGenerator,CachingImageEmbeddingGenerator,CachingImageNarrator,CachingTextEmbeddingGenerator,ChatImageNarrator,FileImageMetadataNarrator,ImageMetadataNarrator,MapCachingEmbeddingGenerator,TextFloatVectorCharChunkingEmbeddings,TextFloatVectorChunkingEmbeddingModel,TextFloatVectorEncodingChunkingEmbeddingModel,UriImageMetadataNarrator,UrlImageMetadataNarrator
Generates an embedding from source.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault <V> EmbeddingGenerator<V, E> default EmbeddingGenerator<S, E> compose(EmbeddingGenerator<? super S, ? extends E> other, BinaryOperator<E> composer) Calls this embedding generator and returns its return value if it is not null and composer is null.default EmbeddingGenerator<S, E> compose(EmbeddingGenerator<S, E> other) static <S,E> EmbeddingGenerator <S, E> compose(EmbeddingGenerator<S, E> a, EmbeddingGenerator<S, E> b, BinaryOperator<E> composer) default EmbeddingGenerator<S, E> composeAsync(EmbeddingGenerator<? super S, ? extends E> other, BiFunction<? super E, ? super E, reactor.core.publisher.Mono<E>> composer) Calls this embedding generator and returns its return value if it is not null and composer is null.generate(Collection<S> input) Batch generationdefault EgenerateAsync(Collection<S> input) Asynchronous batch generationreactor.core.publisher.Mono<E> generateAsync(S input) static <S,E> Optional <EmbeddingGenerator<S, E>> reduce(Stream<EmbeddingGenerator<S, E>> stream, BinaryOperator<E> composer) default <F> EmbeddingGenerator<S, F> then(EmbeddingGenerator<E, F> next)
-
Method Details
-
generate
-
generateAsync
-
generate
Batch generation -
generateAsync
Asynchronous batch generation -
then
-
adapt
-
compose
default EmbeddingGenerator<S,E> compose(EmbeddingGenerator<? super S, ? extends E> other, BinaryOperator<E> composer) Calls this embedding generator and returns its return value if it is not null and composer is null. Otherwise calls the other embedding generator and then composes results by calling the composer argument.- Parameters:
other-- Returns:
-
composeAsync
default EmbeddingGenerator<S,E> composeAsync(EmbeddingGenerator<? super S, ? extends E> other, BiFunction<? super E, ? super E, reactor.core.publisher.Mono<E>> composer) Calls this embedding generator and returns its return value if it is not null and composer is null. Otherwise calls the other embedding generator and then composes results by calling the composer argument.- Parameters:
other-- Returns:
-
compose
- Specified by:
composein interfaceComposable<S>
-
compose
static <S,E> EmbeddingGenerator<S,E> compose(EmbeddingGenerator<S, E> a, EmbeddingGenerator<S, E> b, BinaryOperator<E> composer) - Type Parameters:
T- Instances of T shall implementComposable.- Returns:
- Composing operator which can be use in reducing streams of
Composables to a single composeable.
-
reduce
static <S,E> Optional<EmbeddingGenerator<S,E>> reduce(Stream<EmbeddingGenerator<S, E>> stream, BinaryOperator<E> composer)
-