Skip to content

Commit

Permalink
Merge pull request #21 from Martin7-1/ollama-custom-headers
Browse files Browse the repository at this point in the history
add Ollama SB starter custom headers
  • Loading branch information
langchain4j authored May 10, 2024
2 parents 07d4114 + 0a5d4ec commit ba95eac
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ OllamaChatModel ollamaChatModel(Properties properties) {
.format(chatModelProperties.getFormat())
.timeout(chatModelProperties.getTimeout())
.maxRetries(chatModelProperties.getMaxRetries())
.customHeaders(chatModelProperties.getCustomHeaders())
.build();
}

Expand All @@ -48,6 +49,7 @@ OllamaStreamingChatModel ollamaStreamingChatModel(Properties properties) {
.stop(chatModelProperties.getStop())
.format(chatModelProperties.getFormat())
.timeout(chatModelProperties.getTimeout())
.customHeaders(chatModelProperties.getCustomHeaders())
.build();
}

Expand All @@ -68,6 +70,7 @@ OllamaLanguageModel ollamaLanguageModel(Properties properties) {
.format(languageModelProperties.getFormat())
.timeout(languageModelProperties.getTimeout())
.maxRetries(languageModelProperties.getMaxRetries())
.customHeaders(languageModelProperties.getCustomHeaders())
.build();
}

Expand All @@ -87,6 +90,7 @@ OllamaStreamingLanguageModel ollamaStreamingLanguageModel(Properties properties)
.stop(languageModelProperties.getStop())
.format(languageModelProperties.getFormat())
.timeout(languageModelProperties.getTimeout())
.customHeaders(languageModelProperties.getCustomHeaders())
.build();
}

Expand All @@ -99,6 +103,7 @@ OllamaEmbeddingModel ollamaEmbeddingModel(Properties properties) {
.modelName(embeddingModelProperties.getModelName())
.timeout(embeddingModelProperties.getTimeout())
.maxRetries(embeddingModelProperties.getMaxRetries())
.customHeaders(embeddingModelProperties.getCustomHeaders())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.time.Duration;
import java.util.List;
import java.util.Map;

@Getter
@Setter
Expand All @@ -22,4 +23,5 @@ class ChatModelProperties {
String format;
Duration timeout;
Integer maxRetries;
Map<String, String> customHeaders;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Setter;

import java.time.Duration;
import java.util.Map;

@Getter
@Setter
Expand All @@ -13,4 +14,5 @@ class EmbeddingModelProperties {
String modelName;
Duration timeout;
Integer maxRetries;
Map<String, String> customHeaders;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.time.Duration;
import java.util.List;
import java.util.Map;

@Getter
@Setter
Expand All @@ -22,4 +23,5 @@ class LanguageModelProperties {
String format;
Duration timeout;
Integer maxRetries;
Map<String, String> customHeaders;
}
Empty file modified mvnw
100644 → 100755
Empty file.

0 comments on commit ba95eac

Please sign in to comment.