Skip to content

Commit 5da44c4

Browse files
yuhangbinmarkpollack
authored andcommitted
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.
1 parent a55316c commit 5da44c4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,13 @@ var ollamaApi = new OllamaApi();
184184
var embeddingModel = new OllamaEmbeddingModel(ollamaApi,
185185
OllamaOptions.builder()
186186
.withModel(OllamaModel.MISTRAL.id())
187-
.build()
188-
.toMap());
187+
.build());
189188
190189
EmbeddingResponse embeddingResponse = embeddingModel.call(
191190
new EmbeddingRequest(List.of("Hello World", "World is big and salvation is near"),
192191
OllamaOptions.builder()
193192
.withModel("chroma/all-minilm-l6-v2-f32"))
194-
.withtTruncate(false)
193+
.withTruncate(false)
195194
.build());
196195
----
197196

0 commit comments

Comments
 (0)