Class WorkersAiEmbeddingModel
java.lang.Object
dev.langchain4j.model.workersai.client.AbstractWorkersAIModel
dev.langchain4j.model.workersai.WorkersAiEmbeddingModel
- All Implemented Interfaces:
EmbeddingModel
WorkerAI Embedding model.
...
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class AbstractWorkersAIModel
accountId, modelName, workerAiClient -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with Builder.WorkersAiEmbeddingModel(String accountId, String modelName, String apiToken) Constructor with Builder. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Builder access.embed(TextSegment textSegment) Embed the text content of a TextSegment.Embed a text.embedAll(List<TextSegment> textSegments) Embeds the text content of a list of TextSegments.Returns the name of the underlying embedding model.Methods inherited from class AbstractWorkersAIModel
processErrorsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmbeddingModel
dimension
-
Constructor Details
-
WorkersAiEmbeddingModel
Constructor with Builder.- Parameters:
builder- builder.
-
WorkersAiEmbeddingModel
-
-
Method Details
-
builder
-
embed
Embed a text.- Specified by:
embedin interfaceEmbeddingModel- Parameters:
text- the text to embed.- Returns:
- the embedding.
-
embed
Embed the text content of a TextSegment.- Specified by:
embedin interfaceEmbeddingModel- Parameters:
textSegment- the text segment to embed.- Returns:
- the embedding.
-
embedAll
Embeds the text content of a list of TextSegments.- Specified by:
embedAllin interfaceEmbeddingModel- Parameters:
textSegments- the text segments to embed.- Returns:
- the embeddings.
-
modelName
Description copied from interface:EmbeddingModelReturns the name of the underlying embedding model.Implementations are encouraged to override this method and provide the actual model name. The default implementation returns
"unknown", which indicates that the model name is unknown.- Specified by:
modelNamein interfaceEmbeddingModel- Returns:
- the model name or a fallback value if not provided
-