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/Shared/ResponseFormat.swift
+39-13
Original file line number
Diff line number
Diff line change
@@ -8,18 +8,44 @@
8
8
import Foundation
9
9
10
10
11
-
publicstructResponseFormat:Codable{
12
-
13
-
/// Defaults to text
14
-
/// Setting to `json_object` enables JSON mode. This guarantees that the message the model generates is valid JSON.
15
-
/// Note that your system prompt must still instruct the model to produce JSON, and to help ensure you don't forget, the API will throw an error if the string JSON does not appear in your system message.
16
-
/// 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.
17
-
/// Must be one of `text `or `json_object`.
18
-
publicvartype:String?
19
-
20
-
publicinit(
21
-
type:String?)
22
-
{
23
-
self.type = type
11
+
/// Defaults to text
12
+
/// Setting to `json_object` enables JSON mode. This guarantees that the message the model generates is valid JSON.
13
+
/// Note that your system prompt must still instruct the model to produce JSON, and to help ensure you don't forget, the API will throw an error if the string JSON does not appear in your system message.
14
+
/// 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.
0 commit comments