From 85ed261c08c4e3c066f2857768f9fa5679c8b012 Mon Sep 17 00:00:00 2001 From: Thomas Vitale Date: Thu, 25 Jan 2024 15:17:50 +0100 Subject: [PATCH] Include metadata for nested config props in Ollama (#247) Fixes gh-246 Signed-off-by: Thomas Vitale --- .../ai/autoconfigure/ollama/OllamaChatProperties.java | 2 ++ .../ai/autoconfigure/ollama/OllamaEmbeddingProperties.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/ollama/OllamaChatProperties.java b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/ollama/OllamaChatProperties.java index 1b07aca6f..7e662836f 100644 --- a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/ollama/OllamaChatProperties.java +++ b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/ollama/OllamaChatProperties.java @@ -18,6 +18,7 @@ package org.springframework.ai.autoconfigure.ollama; import org.springframework.ai.ollama.api.OllamaOptions; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * Ollama Chat autoconfiguration properties. @@ -40,6 +41,7 @@ public class OllamaChatProperties { * topK and topP and alike parameters. The null values are ignored defaulting to the * generative's defaults. */ + @NestedConfigurationProperty private OllamaOptions options = new OllamaOptions(); public String getModel() { diff --git a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/ollama/OllamaEmbeddingProperties.java b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/ollama/OllamaEmbeddingProperties.java index f4039bf57..cade107fa 100644 --- a/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/ollama/OllamaEmbeddingProperties.java +++ b/spring-ai-spring-boot-autoconfigure/src/main/java/org/springframework/ai/autoconfigure/ollama/OllamaEmbeddingProperties.java @@ -18,6 +18,7 @@ package org.springframework.ai.autoconfigure.ollama; import org.springframework.ai.ollama.api.OllamaOptions; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * Ollama Embedding autoconfiguration properties. @@ -40,6 +41,7 @@ public class OllamaEmbeddingProperties { * topK and topP and alike parameters. The null values are ignored defaulting to the * generative's defaults. */ + @NestedConfigurationProperty private OllamaOptions options = new OllamaOptions(); public String getModel() {