Skip to content

Commit

Permalink
added proxy properties
Browse files Browse the repository at this point in the history
  • Loading branch information
langchain4j committed Dec 22, 2023
1 parent 227f772 commit 624eb68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ OpenAiChatModel openAiChatModel(Properties properties) {
.user(chatModelProperties.getUser())
.timeout(chatModelProperties.getTimeout())
.maxRetries(chatModelProperties.getMaxRetries())
.proxy(ProxyProperties.toProxy(chatModelProperties.getProxy()))
.proxy(ProxyProperties.convert(chatModelProperties.getProxy()))
.logRequests(chatModelProperties.getLogRequests())
.logResponses(chatModelProperties.getLogResponses())
.build();
Expand All @@ -59,7 +59,7 @@ OpenAiStreamingChatModel openAiStreamingChatModel(Properties properties) {
.seed(chatModelProperties.getSeed())
.user(chatModelProperties.getUser())
.timeout(chatModelProperties.getTimeout())
.proxy(ProxyProperties.toProxy(chatModelProperties.getProxy()))
.proxy(ProxyProperties.convert(chatModelProperties.getProxy()))
.logRequests(chatModelProperties.getLogRequests())
.logResponses(chatModelProperties.getLogResponses())
.build();
Expand All @@ -77,7 +77,7 @@ OpenAiLanguageModel openAiLanguageModel(Properties properties) {
.temperature(languageModelProperties.getTemperature())
.timeout(languageModelProperties.getTimeout())
.maxRetries(languageModelProperties.getMaxRetries())
.proxy(ProxyProperties.toProxy(languageModelProperties.getProxy()))
.proxy(ProxyProperties.convert(languageModelProperties.getProxy()))
.logRequests(languageModelProperties.getLogRequests())
.logResponses(languageModelProperties.getLogResponses())
.build();
Expand All @@ -94,7 +94,7 @@ OpenAiStreamingLanguageModel openAiStreamingLanguageModel(Properties properties)
.modelName(languageModelProperties.getModelName())
.temperature(languageModelProperties.getTemperature())
.timeout(languageModelProperties.getTimeout())
.proxy(ProxyProperties.toProxy(languageModelProperties.getProxy()))
.proxy(ProxyProperties.convert(languageModelProperties.getProxy()))
.logRequests(languageModelProperties.getLogRequests())
.logResponses(languageModelProperties.getLogResponses())
.build();
Expand All @@ -112,7 +112,7 @@ OpenAiEmbeddingModel openAiEmbeddingModel(Properties properties) {
.user(embeddingModelProperties.getUser())
.timeout(embeddingModelProperties.getTimeout())
.maxRetries(embeddingModelProperties.getMaxRetries())
.proxy(ProxyProperties.toProxy(embeddingModelProperties.getProxy()))
.proxy(ProxyProperties.convert(embeddingModelProperties.getProxy()))
.logRequests(embeddingModelProperties.getLogRequests())
.logResponses(embeddingModelProperties.getLogResponses())
.build();
Expand All @@ -129,7 +129,7 @@ OpenAiModerationModel openAiModerationModel(Properties properties) {
.modelName(moderationModelProperties.getModelName())
.timeout(moderationModelProperties.getTimeout())
.maxRetries(moderationModelProperties.getMaxRetries())
.proxy(ProxyProperties.toProxy(moderationModelProperties.getProxy()))
.proxy(ProxyProperties.convert(moderationModelProperties.getProxy()))
.logRequests(moderationModelProperties.getLogRequests())
.logResponses(moderationModelProperties.getLogResponses())
.build();
Expand All @@ -151,7 +151,7 @@ OpenAiImageModel openAiImageModel(Properties properties) {
.responseFormat(imageModelProperties.getResponseFormat())
.timeout(imageModelProperties.getTimeout())
.maxRetries(imageModelProperties.getMaxRetries())
.proxy(ProxyProperties.toProxy(imageModelProperties.getProxy()))
.proxy(ProxyProperties.convert(imageModelProperties.getProxy()))
.logRequests(imageModelProperties.getLogRequests())
.logResponses(imageModelProperties.getLogResponses())
.withPersisting(imageModelProperties.getWithPersisting())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ProxyProperties {
String host;
Integer port;

static Proxy toProxy(ProxyProperties proxy) {
static Proxy convert(ProxyProperties proxy) {
if (proxy == null) {
return null;
}
Expand Down

0 comments on commit 624eb68

Please sign in to comment.