File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Sources/OpenAI/Public/Shared Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public struct TextConfiguration: Codable {
24
24
/// Format types for text response
25
25
public enum FormatType : Codable {
26
26
case text
27
- case jsonSchema( JSONSchema )
27
+ case jsonSchema( JSONSchema , name : String ? = nil )
28
28
case jsonObject
29
29
30
30
public init ( from decoder: Decoder ) throws {
@@ -57,8 +57,9 @@ public enum FormatType: Codable {
57
57
case . text:
58
58
try container. encode ( " text " , forKey: . type)
59
59
60
- case . jsonSchema( let schema) :
60
+ case let . jsonSchema( schema, name ) :
61
61
try container. encode ( " json_schema " , forKey: . type)
62
+ try container. encode ( name ?? " schema_response " , forKey: . name)
62
63
try container. encode ( schema, forKey: . schema)
63
64
64
65
case . jsonObject:
@@ -69,6 +70,7 @@ public enum FormatType: Codable {
69
70
enum CodingKeys : String , CodingKey {
70
71
case type
71
72
case schema
73
+ case name
72
74
}
73
75
74
76
}
You can’t perform that action at this time.
0 commit comments