You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/OpenAI/Public/Parameters/Chat/ChatCompletionParameters.swift
+22
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,8 @@ public struct ChatCompletionParameters: Encodable {
29
29
publicvarfunctions:[ChatFunction]?
30
30
/// A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for.
31
31
publicvartools:[Tool]?
32
+
/// Whether to enable parallel function calling during tool use. Defaults to true.
33
+
publicvarparallelToolCalls:Bool?
32
34
/// Modify the likelihood of specified tokens appearing in the completion.
33
35
/// Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. Defaults to null.
34
36
publicvarlogitBias:[Int:Double]?
@@ -48,6 +50,11 @@ public struct ChatCompletionParameters: Encodable {
48
50
/// Setting to `{ type: "json_object" }` enables `JSON` mode, which guarantees the message the model generates is valid JSON.
49
51
///Important: when using `JSON` mode you must still instruct the model to produce `JSON` yourself via some conversation message, for example via your system message. If you don't do this, the model may generate an unending stream of whitespace until the generation reaches the token limit, which may take a lot of time and give the appearance of a "stuck" request. Also note that the message content may be partial (i.e. cut off) if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length.
50
52
publicvarresponseFormat:ResponseFormat?
53
+
/// Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service:
54
+
/// If set to 'auto', the system will utilize scale tier credits until they are exhausted.
55
+
/// If set to 'default', the request will be processed in the shared cluster.
56
+
/// When this parameter is set, the response body will include the service_tier utilized.
57
+
publicvarserviceTier:String?
51
58
/// This feature is in `Beta`. If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.
52
59
/// Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.
53
60
publicvarseed:Int?
@@ -418,6 +425,15 @@ public struct ChatCompletionParameters: Encodable {
418
425
}
419
426
}
420
427
428
+
publicenumServiceTier:String,Encodable{
429
+
/// Specifies the latency tier to use for processing the request. This parameter is relevant for customers subscribed to the scale tier service:
430
+
/// If set to 'auto', the system will utilize scale tier credits until they are exhausted.
431
+
/// If set to 'default', the request will be processed in the shared cluster.
432
+
/// When this parameter is set, the response body will include the service_tier utilized.
433
+
case auto
434
+
case `default`
435
+
}
436
+
421
437
publicstructStreamOptions:Encodable{
422
438
/// If set, an additional chunk will be streamed before the data: [DONE] message.
423
439
/// The usage field on this chunk shows the token usage statistics for the entire request,
@@ -437,6 +453,7 @@ public struct ChatCompletionParameters: Encodable {
437
453
case toolChoice ="tool_choice"
438
454
case functionCall ="function_call"
439
455
case tools
456
+
case parallelToolCalls ="parallel_tool_calls"
440
457
case functions
441
458
case logitBias ="logit_bias"
442
459
case logprobs
@@ -446,6 +463,7 @@ public struct ChatCompletionParameters: Encodable {
446
463
case responseFormat ="response_format"
447
464
case presencePenalty ="presence_penalty"
448
465
case seed
466
+
case serviceTier ="service_tier"
449
467
case stop
450
468
case stream
451
469
case streamOptions ="stream_options"
@@ -462,13 +480,15 @@ public struct ChatCompletionParameters: Encodable {
462
480
toolChoice:ToolChoice?=nil,
463
481
functions:[ChatFunction]?=nil,
464
482
tools:[Tool]?=nil,
483
+
parallelToolCalls:Bool?=nil,
465
484
logitBias:[Int:Double]?=nil,
466
485
logProbs:Bool?=nil,
467
486
topLogprobs:Int?=nil,
468
487
maxTokens:Int?=nil,
469
488
n:Int?=nil,
470
489
responseFormat:ResponseFormat?=nil,
471
490
presencePenalty:Double?=nil,
491
+
serviceTier:ServiceTier?=nil,
472
492
seed:Int?=nil,
473
493
stop:[String]?=nil,
474
494
temperature:Double?=nil,
@@ -482,13 +502,15 @@ public struct ChatCompletionParameters: Encodable {
0 commit comments