OllamaEmbeddingsModel class
Ollama embeddings model implementation.
- Inheritance
-
- Object
- EmbeddingsModel<
OllamaEmbeddingsModelOptions> - OllamaEmbeddingsModel
Constructors
-
OllamaEmbeddingsModel({required String name, Uri? baseUrl, Client? client, Map<
String, String> ? headers, int? dimensions, int? batchSize = 100, OllamaEmbeddingsModelOptions? options}) - Creates a new Ollama embeddings model.
Properties
- batchSize → int?
-
The maximum number of texts to embed in a single request.
finalinherited
- defaultOptions → OllamaEmbeddingsModelOptions
-
The default options for the embeddings model.
finalinherited
- dimensions → int?
-
The number of dimensions the resulting output embeddings should have.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
The model name to use.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → void -
Disposes the embeddings model.
override
-
embedDocuments(
List< String> texts, {OllamaEmbeddingsModelOptions? options}) → Future<BatchEmbeddingsResult> -
Embed texts and return results with usage data.
override
-
embedQuery(
String query, {OllamaEmbeddingsModelOptions? options}) → Future< EmbeddingsResult> -
Embed query text and return result with usage data.
override
-
getIndexesMostSimilarEmbeddings(
List< double> embedding, List<List< embeddings, {double similarityFunction(List<double> >double> a, List<double> b) = cosineSimilarity}) → List<int> -
Returns a sorted list of indexes of
embeddingsthat are most similar to the providedembedding(in descending order, most similar first).inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited