Package com.langchainbeam
Class EmbeddingModelHandler
java.lang.Object
com.langchainbeam.EmbeddingModelHandler
- All Implemented Interfaces:
Serializable
A handler for managing embedding model operations in an Apache Beam pipeline.
The EmbeddingModelHandler
is responsible for configuring and
utilizing
an embedding model based on the provided EmbeddingModelOptions
. It
acts as
a bridge between the embedding model and the Beam transforms, ensuring that
embeddings are generated with the specified model settings.
Key Responsibilities:
- Holds and manages
EmbeddingModelOptions
, which define the model name, dimensions, and other relevant settings. - Provides access to the model options via the
getOptions()
method.
Usage:
EmbeddingModelOptions options = OpenAiEmbeddingModelOptions.builder()
.apikey("your-api-key")
.modelName("text-embedding-ada-002")
.build();
EmbeddingModelHandler handler = new EmbeddingModelHandler(options);
EmbeddingModelOptions retrievedOptions = handler.getOptions();
System.out.println("Using model: " + retrievedOptions.getModelName());
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddingModelHandler
(EmbeddingModelOptions modelOptions) Constructs anEmbeddingModelHandler
with the specified options. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves theEmbeddingModelOptions
associated with this handler.
-
Constructor Details
-
EmbeddingModelHandler
Constructs anEmbeddingModelHandler
with the specified options.- Parameters:
modelOptions
- the options defining the embedding model configuration. Must not benull
.
-
-
Method Details
-
getOptions
Retrieves theEmbeddingModelOptions
associated with this handler.- Returns:
- the options defining the embedding model configuration.
-