Skip to content

Commit

Permalink
Added logRequests/logResponses properties to Ollama SB starter langch…
Browse files Browse the repository at this point in the history
  • Loading branch information
langchain4j committed Jun 11, 2024
1 parent 20a79ef commit a3d5a36
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ OllamaChatModel ollamaChatModel(Properties properties) {
.timeout(chatModelProperties.getTimeout())
.maxRetries(chatModelProperties.getMaxRetries())
.customHeaders(chatModelProperties.getCustomHeaders())
.logRequests(chatModelProperties.getLogRequests())
.logResponses(chatModelProperties.getLogResponses())
.build();
}

Expand All @@ -50,6 +52,8 @@ OllamaStreamingChatModel ollamaStreamingChatModel(Properties properties) {
.format(chatModelProperties.getFormat())
.timeout(chatModelProperties.getTimeout())
.customHeaders(chatModelProperties.getCustomHeaders())
.logRequests(chatModelProperties.getLogRequests())
.logResponses(chatModelProperties.getLogResponses())
.build();
}

Expand All @@ -71,6 +75,8 @@ OllamaLanguageModel ollamaLanguageModel(Properties properties) {
.timeout(languageModelProperties.getTimeout())
.maxRetries(languageModelProperties.getMaxRetries())
.customHeaders(languageModelProperties.getCustomHeaders())
.logRequests(languageModelProperties.getLogRequests())
.logResponses(languageModelProperties.getLogResponses())
.build();
}

Expand All @@ -91,6 +97,8 @@ OllamaStreamingLanguageModel ollamaStreamingLanguageModel(Properties properties)
.format(languageModelProperties.getFormat())
.timeout(languageModelProperties.getTimeout())
.customHeaders(languageModelProperties.getCustomHeaders())
.logRequests(languageModelProperties.getLogRequests())
.logResponses(languageModelProperties.getLogResponses())
.build();
}

Expand All @@ -104,6 +112,8 @@ OllamaEmbeddingModel ollamaEmbeddingModel(Properties properties) {
.timeout(embeddingModelProperties.getTimeout())
.maxRetries(embeddingModelProperties.getMaxRetries())
.customHeaders(embeddingModelProperties.getCustomHeaders())
.logRequests(embeddingModelProperties.getLogRequests())
.logResponses(embeddingModelProperties.getLogResponses())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ class ChatModelProperties {
Duration timeout;
Integer maxRetries;
Map<String, String> customHeaders;
Boolean logRequests;
Boolean logResponses;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ class EmbeddingModelProperties {
Duration timeout;
Integer maxRetries;
Map<String, String> customHeaders;
Boolean logRequests;
Boolean logResponses;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ class LanguageModelProperties {
Duration timeout;
Integer maxRetries;
Map<String, String> customHeaders;
Boolean logRequests;
Boolean logResponses;
}

0 comments on commit a3d5a36

Please sign in to comment.