Skip to content

Commit 952c9a5

Browse files
newtorkrpanackal
andauthored
chore: [Orchestration] (and OpenAI) Migrate max_token parameter (#629)
* Initial * Update OpenAiChatModel * Update tests --------- Co-authored-by: Roshin Rajan Panackal <[email protected]>
1 parent 4ae4437 commit 952c9a5

File tree

1 file changed

+4
-1
lines changed
  • foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/spring

1 file changed

+4
-1
lines changed

foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/spring/OpenAiChatModel.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ private static Generation toGeneration(
187187
@Nonnull
188188
protected static OpenAiChatCompletionRequest extractOptions(
189189
@Nonnull OpenAiChatCompletionRequest request, @Nonnull final ChatOptions options) {
190-
request = request.withStop(options.getStopSequences()).withMaxTokens(options.getMaxTokens());
190+
request =
191+
request
192+
.withStop(options.getStopSequences())
193+
.withMaxCompletionTokens(options.getMaxTokens());
191194
if (options.getTemperature() != null) {
192195
request = request.withTemperature(BigDecimal.valueOf(options.getTemperature()));
193196
}

0 commit comments

Comments
 (0)