Fix code example in ollama-embeddings documentation

Correct the OllamaEmbeddingModel initialization and options syntax in
the ollama-embeddings.adoc file. Remove unnecessary .toMap() call and
fix typo in withTruncate method name.
This commit is contained in:
cboy
2024-09-25 00:38:52 +08:00
committed by Mark Pollack
parent a55316c44d
commit 5da44c4b45

View File

@@ -184,14 +184,13 @@ var ollamaApi = new OllamaApi();
var embeddingModel = new OllamaEmbeddingModel(ollamaApi,
OllamaOptions.builder()
.withModel(OllamaModel.MISTRAL.id())
.build()
.toMap());
.build());
EmbeddingResponse embeddingResponse = embeddingModel.call(
new EmbeddingRequest(List.of("Hello World", "World is big and salvation is near"),
OllamaOptions.builder()
.withModel("chroma/all-minilm-l6-v2-f32"))
.withtTruncate(false)
.withTruncate(false)
.build());
----