diff --git a/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/AutoConfig.java b/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/AutoConfig.java index dff33a5d..a4f18170 100644 --- a/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/AutoConfig.java +++ b/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/AutoConfig.java @@ -29,6 +29,7 @@ OllamaChatModel ollamaChatModel(Properties properties) { .format(chatModelProperties.getFormat()) .timeout(chatModelProperties.getTimeout()) .maxRetries(chatModelProperties.getMaxRetries()) + .customHeaders(chatModelProperties.getCustomHeaders()) .build(); } @@ -48,6 +49,7 @@ OllamaStreamingChatModel ollamaStreamingChatModel(Properties properties) { .stop(chatModelProperties.getStop()) .format(chatModelProperties.getFormat()) .timeout(chatModelProperties.getTimeout()) + .customHeaders(chatModelProperties.getCustomHeaders()) .build(); } @@ -68,6 +70,7 @@ OllamaLanguageModel ollamaLanguageModel(Properties properties) { .format(languageModelProperties.getFormat()) .timeout(languageModelProperties.getTimeout()) .maxRetries(languageModelProperties.getMaxRetries()) + .customHeaders(languageModelProperties.getCustomHeaders()) .build(); } @@ -87,6 +90,7 @@ OllamaStreamingLanguageModel ollamaStreamingLanguageModel(Properties properties) .stop(languageModelProperties.getStop()) .format(languageModelProperties.getFormat()) .timeout(languageModelProperties.getTimeout()) + .customHeaders(languageModelProperties.getCustomHeaders()) .build(); } @@ -99,6 +103,7 @@ OllamaEmbeddingModel ollamaEmbeddingModel(Properties properties) { .modelName(embeddingModelProperties.getModelName()) .timeout(embeddingModelProperties.getTimeout()) .maxRetries(embeddingModelProperties.getMaxRetries()) + .customHeaders(embeddingModelProperties.getCustomHeaders()) .build(); } } \ No newline at end of file diff --git a/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/ChatModelProperties.java b/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/ChatModelProperties.java index 4aed4397..b97ab461 100644 --- a/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/ChatModelProperties.java +++ b/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/ChatModelProperties.java @@ -5,6 +5,7 @@ import java.time.Duration; import java.util.List; +import java.util.Map; @Getter @Setter @@ -22,4 +23,5 @@ class ChatModelProperties { String format; Duration timeout; Integer maxRetries; + Map customHeaders; } \ No newline at end of file diff --git a/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/EmbeddingModelProperties.java b/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/EmbeddingModelProperties.java index 512ae78e..db989e6e 100644 --- a/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/EmbeddingModelProperties.java +++ b/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/EmbeddingModelProperties.java @@ -4,6 +4,7 @@ import lombok.Setter; import java.time.Duration; +import java.util.Map; @Getter @Setter @@ -13,4 +14,5 @@ class EmbeddingModelProperties { String modelName; Duration timeout; Integer maxRetries; + Map customHeaders; } \ No newline at end of file diff --git a/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/LanguageModelProperties.java b/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/LanguageModelProperties.java index 6346005c..f808fc08 100644 --- a/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/LanguageModelProperties.java +++ b/langchain4j-ollama-spring-boot-starter/src/main/java/dev/langchain4j/ollama/spring/LanguageModelProperties.java @@ -5,6 +5,7 @@ import java.time.Duration; import java.util.List; +import java.util.Map; @Getter @Setter @@ -22,4 +23,5 @@ class LanguageModelProperties { String format; Duration timeout; Integer maxRetries; + Map customHeaders; } \ No newline at end of file diff --git a/mvnw b/mvnw old mode 100644 new mode 100755