Add support for custom base url for OpenAI model in Spring Boot starter (#228)
This commit is contained in:
parent
f43cc8f4ca
commit
9719d8233f
|
@ -46,6 +46,7 @@ public class LangChain4jAutoConfiguration {
|
|||
throw illegalConfiguration("\n\nPlease define 'langchain4j.chat-model.openai.api-key' property");
|
||||
}
|
||||
return OpenAiChatModel.builder()
|
||||
.baseUrl(openAi.getBaseUrl())
|
||||
.apiKey(openAi.getApiKey())
|
||||
.modelName(openAi.getModelName())
|
||||
.temperature(openAi.getTemperature())
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.time.Duration;
|
|||
|
||||
class OpenAi {
|
||||
|
||||
private String baseUrl;
|
||||
private String apiKey;
|
||||
private String modelName;
|
||||
private Double temperature;
|
||||
|
@ -16,6 +17,14 @@ class OpenAi {
|
|||
private Boolean logRequests;
|
||||
private Boolean logResponses;
|
||||
|
||||
public String getBaseUrl() {
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
public void setBaseUrl(String baseUrl) {
|
||||
this.baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
public String getApiKey() {
|
||||
return apiKey;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue