@@ -358,6 +358,8 @@ public Function(String description, String name, String jsonSchema) {
358
358
* function. Specifying a particular function via {"type: "function", "function": {"name": "my_function"}} forces
359
359
* the model to call that function. none is the default when no functions are present. auto is the default if
360
360
* functions are present. Use the {@link ToolChoiceBuilder} to create the tool choice value.
361
+ * @param parallelToolCalls If set to true, the model will call all functions in the tools list in parallel. If set
362
+ * to false, the model will call the functions in the tools list in the order they are provided.
361
363
* @param user A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
362
364
*
363
365
*/
@@ -381,6 +383,7 @@ public record ChatCompletionRequest (
381
383
@ JsonProperty ("top_p" ) Float topP ,
382
384
@ JsonProperty ("tools" ) List <FunctionTool > tools ,
383
385
@ JsonProperty ("tool_choice" ) Object toolChoice ,
386
+ @ JsonProperty ("parallel_tool_calls" ) Boolean parallelToolCalls ,
384
387
@ JsonProperty ("user" ) String user ) {
385
388
386
389
/**
@@ -393,7 +396,7 @@ public record ChatCompletionRequest (
393
396
public ChatCompletionRequest (List <ChatCompletionMessage > messages , String model , Float temperature ) {
394
397
this (messages , model , null , null , null , null , null , null , null ,
395
398
null , null , null , false , null , temperature , null ,
396
- null , null , null );
399
+ null , null , null , null );
397
400
}
398
401
399
402
/**
@@ -408,7 +411,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model,
408
411
public ChatCompletionRequest (List <ChatCompletionMessage > messages , String model , Float temperature , boolean stream ) {
409
412
this (messages , model , null , null , null , null , null , null , null ,
410
413
null , null , null , stream , null , temperature , null ,
411
- null , null , null );
414
+ null , null , null , null );
412
415
}
413
416
414
417
/**
@@ -424,7 +427,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model,
424
427
List <FunctionTool > tools , Object toolChoice ) {
425
428
this (messages , model , null , null , null , null , null , null , null ,
426
429
null , null , null , false , null , 0.8f , null ,
427
- tools , toolChoice , null );
430
+ tools , toolChoice , null , null );
428
431
}
429
432
430
433
/**
@@ -437,7 +440,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model,
437
440
public ChatCompletionRequest (List <ChatCompletionMessage > messages , Boolean stream ) {
438
441
this (messages , null , null , null , null , null , null , null , null ,
439
442
null , null , null , stream , null , null , null ,
440
- null , null , null );
443
+ null , null , null , null );
441
444
}
442
445
443
446
/**
@@ -449,7 +452,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, Boolean strea
449
452
public ChatCompletionRequest withStreamOptions (StreamOptions streamOptions ) {
450
453
return new ChatCompletionRequest (messages , model , frequencyPenalty , logitBias , logprobs , topLogprobs , maxTokens , n , presencePenalty ,
451
454
responseFormat , seed , stop , stream , streamOptions , temperature , topP ,
452
- tools , toolChoice , user );
455
+ tools , toolChoice , parallelToolCalls , user );
453
456
}
454
457
455
458
/**
0 commit comments