Skip to content

Commit a077e1b

Browse files
committed
patch for 3f19c4a
1 parent 3f19c4a commit a077e1b

File tree

1 file changed

+8
-5
lines changed
  • models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api

1 file changed

+8
-5
lines changed

models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiApi.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,8 @@ public Function(String description, String name, String jsonSchema) {
358358
* function. Specifying a particular function via {"type: "function", "function": {"name": "my_function"}} forces
359359
* the model to call that function. none is the default when no functions are present. auto is the default if
360360
* 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.
361363
* @param user A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
362364
*
363365
*/
@@ -381,6 +383,7 @@ public record ChatCompletionRequest (
381383
@JsonProperty("top_p") Float topP,
382384
@JsonProperty("tools") List<FunctionTool> tools,
383385
@JsonProperty("tool_choice") Object toolChoice,
386+
@JsonProperty("parallel_tool_calls") Boolean parallelToolCalls,
384387
@JsonProperty("user") String user) {
385388

386389
/**
@@ -393,7 +396,7 @@ public record ChatCompletionRequest (
393396
public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model, Float temperature) {
394397
this(messages, model, null, null, null, null, null, null, null,
395398
null, null, null, false, null, temperature, null,
396-
null, null, null);
399+
null, null, null, null);
397400
}
398401

399402
/**
@@ -408,7 +411,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model,
408411
public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model, Float temperature, boolean stream) {
409412
this(messages, model, null, null, null, null, null, null, null,
410413
null, null, null, stream, null, temperature, null,
411-
null, null, null);
414+
null, null, null, null);
412415
}
413416

414417
/**
@@ -424,7 +427,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model,
424427
List<FunctionTool> tools, Object toolChoice) {
425428
this(messages, model, null, null, null, null, null, null, null,
426429
null, null, null, false, null, 0.8f, null,
427-
tools, toolChoice, null);
430+
tools, toolChoice, null, null);
428431
}
429432

430433
/**
@@ -437,7 +440,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, String model,
437440
public ChatCompletionRequest(List<ChatCompletionMessage> messages, Boolean stream) {
438441
this(messages, null, null, null, null, null, null, null, null,
439442
null, null, null, stream, null, null, null,
440-
null, null, null);
443+
null, null, null, null);
441444
}
442445

443446
/**
@@ -449,7 +452,7 @@ public ChatCompletionRequest(List<ChatCompletionMessage> messages, Boolean strea
449452
public ChatCompletionRequest withStreamOptions(StreamOptions streamOptions) {
450453
return new ChatCompletionRequest(messages, model, frequencyPenalty, logitBias, logprobs, topLogprobs, maxTokens, n, presencePenalty,
451454
responseFormat, seed, stop, stream, streamOptions, temperature, topP,
452-
tools, toolChoice, user);
455+
tools, toolChoice, parallelToolCalls, user);
453456
}
454457

455458
/**

0 commit comments

Comments
 (0)