diff --git a/langchain4j-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/openai/spring/AutoConfig.java b/langchain4j-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/openai/spring/AutoConfig.java index 29dab48d..d3527a17 100644 --- a/langchain4j-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/openai/spring/AutoConfig.java +++ b/langchain4j-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/openai/spring/AutoConfig.java @@ -26,6 +26,7 @@ OpenAiChatModel openAiChatModel(Properties properties) { .topP(chatModelProperties.getTopP()) .stop(chatModelProperties.getStop()) .maxTokens(chatModelProperties.getMaxTokens()) + .maxCompletionTokens(chatModelProperties.getMaxCompletionTokens()) .presencePenalty(chatModelProperties.getPresencePenalty()) .frequencyPenalty(chatModelProperties.getFrequencyPenalty()) .logitBias(chatModelProperties.getLogitBias()) @@ -57,6 +58,7 @@ OpenAiStreamingChatModel openAiStreamingChatModel(Properties properties) { .topP(chatModelProperties.getTopP()) .stop(chatModelProperties.getStop()) .maxTokens(chatModelProperties.getMaxTokens()) + .maxCompletionTokens(chatModelProperties.getMaxCompletionTokens()) .presencePenalty(chatModelProperties.getPresencePenalty()) .frequencyPenalty(chatModelProperties.getFrequencyPenalty()) .logitBias(chatModelProperties.getLogitBias()) diff --git a/langchain4j-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/openai/spring/ChatModelProperties.java b/langchain4j-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/openai/spring/ChatModelProperties.java index b578cada..4277630a 100644 --- a/langchain4j-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/openai/spring/ChatModelProperties.java +++ b/langchain4j-open-ai-spring-boot-starter/src/main/java/dev/langchain4j/openai/spring/ChatModelProperties.java @@ -20,6 +20,7 @@ class ChatModelProperties { Double topP; List stop; Integer maxTokens; + Integer maxCompletionTokens; Double presencePenalty; Double frequencyPenalty; Map logitBias;