Package org.apache.tika.inference
Interface EmbeddingEngine
- All Superinterfaces:
AutoCloseable,Closeable,Engine
- All Known Implementing Classes:
OpenAIEmbeddingEngine
An engine that turns images into vectors, many per request.
-
Method Summary
Modifier and TypeMethodDescriptionList<float[]> embedImages(List<byte[]> images, List<String> mimeTypes, ParseContext context) One request; the vectors come back in the order of the images.default List<float[]> embedMedia(List<MediaInput> inputs, ParseContext context) One request; the vectors come back in the order of the inputs.List<float[]> embedTexts(List<String> texts, ParseContext context) One request; the vectors come back in the order of the texts.intdefault booleanWhetherembedMedia(java.util.List<org.apache.tika.inference.MediaInput>, org.apache.tika.parser.ParseContext)is implemented; a MEDIA binding on an engine without it fails at load.
-
Method Details
-
embedImages
List<float[]> embedImages(List<byte[]> images, List<String> mimeTypes, ParseContext context) throws IOException, TikaException One request; the vectors come back in the order of the images.- Throws:
IOExceptionTikaException
-
embedTexts
List<float[]> embedTexts(List<String> texts, ParseContext context) throws IOException, TikaException One request; the vectors come back in the order of the texts.- Throws:
IOExceptionTikaException
-
getMaxBatchSize
int getMaxBatchSize() -
supportsMedia
default boolean supportsMedia()WhetherembedMedia(java.util.List<org.apache.tika.inference.MediaInput>, org.apache.tika.parser.ParseContext)is implemented; a MEDIA binding on an engine without it fails at load. -
embedMedia
default List<float[]> embedMedia(List<MediaInput> inputs, ParseContext context) throws IOException, TikaException One request; the vectors come back in the order of the inputs.- Throws:
IOExceptionTikaException
-