We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6f755f commit 5d70745Copy full SHA for 5d70745
1 file changed
Sources/OpenAI/Responses/ResponsesResponse.swift
@@ -86,6 +86,20 @@ public extension Responses {
86
public let truncation: TruncationStrategy?
87
public let usage: Usage
88
89
+ /// Convenience property that contains the aggregated text output from all `output_text`
90
+ /// items in the `output` array, if any are present.
91
+ public var outputText: String? {
92
+ output.reduce(into: "") { partialResult, output in
93
+ if output.type == "message" {
94
+ partialResult += output.content.reduce(into: "") { contentPartialResult, content in
95
+ if content.type == "output_text" {
96
+ contentPartialResult += content.text
97
+ }
98
99
100
101
102
+
103
public struct IncompleteDetails: Decodable, Sendable {
104
public let reason: String
105
}
0 commit comments