Skip to content

Commit

Permalink
Make model name configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-openai committed Feb 17, 2025
1 parent 9498b78 commit e47c7e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
public class AiTranslateConfigurationProperties {
String openaiClientToken;
String schedulerName = QuartzSchedulerManager.DEFAULT_SCHEDULER_NAME;
String modelName = "gpt-4o-2024-08-06";

public String getOpenaiClientToken() {
return openaiClientToken;
Expand All @@ -25,4 +26,12 @@ public String getSchedulerName() {
public void setSchedulerName(String schedulerName) {
this.schedulerName = schedulerName;
}

public String getModelName() {
return modelName;
}

public void setModelName(String modelName) {
this.modelName = modelName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ private Mono<MyRecord> getChatCompletionForTextUnitDTO(

ChatCompletionsRequest chatCompletionsRequest =
chatCompletionsRequest()
.model("gpt-4o-2024-08-06")
.model(aiTranslateConfigurationProperties.getModelName())
.maxTokens(16384)
.messages(
List.of(
Expand Down Expand Up @@ -517,7 +517,7 @@ String generateBatchFileContent(List<TextUnitDTO> textUnitDTOS) {

ChatCompletionsRequest chatCompletionsRequest =
chatCompletionsRequest()
.model("gpt-4o-2024-08-06")
.model(aiTranslateConfigurationProperties.getModelName())
.maxTokens(16384)
.messages(
List.of(
Expand Down

0 comments on commit e47c7e7

Please sign in to comment.