From 5da44c4b45d488b2f1abf7be743cac2a330dcf09 Mon Sep 17 00:00:00 2001 From: cboy <791314183@qq.com> Date: Wed, 25 Sep 2024 00:38:52 +0800 Subject: [PATCH] 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. --- .../modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc index 2f79cd379..eb43d0228 100644 --- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc +++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/api/embeddings/ollama-embeddings.adoc @@ -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()); ----