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: Examples/SwiftOpenAIExample/SwiftOpenAIExample/ChatFunctionsCall/Completion/ChatFunctionCallProvider.swift
Copy file name to clipboardexpand all lines: Examples/SwiftOpenAIExample/SwiftOpenAIExample/ChatStructureOutputTool/ChatStructuredOutputToolProvider.swift
+2-2
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ final class ChatStructuredOutputToolProvider {
Copy file name to clipboardexpand all lines: Sources/OpenAI/Public/ResponseModels/Chat/ChatCompletionObject.swift
+16-16
Original file line number
Diff line number
Diff line change
@@ -11,20 +11,20 @@ import Foundation
11
11
publicstructChatCompletionObject:Decodable{
12
12
13
13
/// A unique identifier for the chat completion.
14
-
publicletid:String
14
+
publicletid:String?
15
15
/// A list of chat completion choices. Can be more than one if n is greater than 1.
16
-
publicletchoices:[ChatChoice]
16
+
publicletchoices:[ChatChoice]?
17
17
/// The Unix timestamp (in seconds) of when the chat completion was created.
18
-
publicletcreated:Int
18
+
publicletcreated:Int?
19
19
/// The model used for the chat completion.
20
-
publicletmodel:String
20
+
publicletmodel:String?
21
21
/// The service tier used for processing the request. This field is only included if the service_tier parameter is specified in the request.
22
22
publicletserviceTier:String?
23
23
/// This fingerprint represents the backend configuration that the model runs with.
24
24
/// Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.
25
25
publicletsystemFingerprint:String?
26
26
/// The object type, which is always chat.completion.
27
-
publicletobject:String
27
+
publicletobject:String?
28
28
/// Usage statistics for the completion request.
29
29
publicletusage:ChatUsage?
30
30
@@ -33,9 +33,9 @@ public struct ChatCompletionObject: Decodable {
33
33
/// The reason the model stopped generating tokens. This will be stop if the model hit a natural stop point or a provided stop sequence, length if the maximum number of tokens specified in the request was reached, content_filter if content was omitted due to a flag from our content filters, tool_calls if the model called a tool, or function_call (deprecated) if the model called a function.
34
34
publicletfinishReason:IntOrStringValue?
35
35
/// The index of the choice in the list of choices.
36
-
publicletindex:Int
36
+
publicletindex:Int?
37
37
/// A chat completion message generated by the model.
38
-
publicletmessage:ChatMessage
38
+
publicletmessage:ChatMessage?
39
39
/// Log probability information for the choice.
40
40
publicletlogprobs:LogProb?
41
41
@@ -49,7 +49,7 @@ public struct ChatCompletionObject: Decodable {
49
49
@available(*, deprecated, message:"Deprecated and replaced by `tool_calls`")
50
50
publicletfunctionCall:FunctionCall?
51
51
/// The role of the author of this message.
52
-
publicletrole:String
52
+
publicletrole:String?
53
53
/// The reasoning content generated by the model, if available.
54
54
publicletreasoningContent:String?
55
55
/// Provided by the Vision API.
@@ -61,12 +61,12 @@ public struct ChatCompletionObject: Decodable {
61
61
62
62
/// Provided by the Vision API.
63
63
publicstructFinishDetails:Decodable{
64
-
lettype:String
64
+
lettype:String?
65
65
}
66
66
67
67
publicstructAudio:Decodable{
68
68
/// Unique identifier for this audio response.
69
-
publicletid:String
69
+
publicletid:String?
70
70
/// The Unix timestamp (in seconds) for when this audio response will no longer be accessible on the server for use in multi-turn conversations.
71
71
publicletexpiresAt:Int?
72
72
/// Base64 encoded audio bytes generated by the model, in the format specified in the request.
@@ -96,18 +96,18 @@ public struct ChatCompletionObject: Decodable {
96
96
97
97
publicstructLogProb:Decodable{
98
98
/// A list of message content tokens with log probability information.
99
-
letcontent:[TokenDetail]
99
+
letcontent:[TokenDetail]?
100
100
}
101
101
102
102
publicstructTokenDetail:Decodable{
103
103
/// The token.
104
-
lettoken:String
104
+
lettoken:String?
105
105
/// The log probability of this token.
106
-
letlogprob:Double
106
+
letlogprob:Double?
107
107
/// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token.
108
108
letbytes:[Int]?
109
109
/// List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested top_logprobs returned.
110
-
lettopLogprobs:[TopLogProb]
110
+
lettopLogprobs:[TopLogProb]?
111
111
112
112
enumCodingKeys:String,CodingKey{
113
113
case token, logprob, bytes
@@ -116,9 +116,9 @@ public struct ChatCompletionObject: Decodable {
116
116
117
117
structTopLogProb:Decodable{
118
118
/// The token.
119
-
lettoken:String
119
+
lettoken:String?
120
120
/// The log probability of this token.
121
-
letlogprob:Double
121
+
letlogprob:Double?
122
122
/// A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token.
0 commit comments