@@ -61,7 +61,7 @@ final public class OpenAI: OpenAIProtocol {
61
61
}
62
62
63
63
public func completionsStream( query: CompletionsQuery , onResult: @escaping ( Result < CompletionsResult , Error > ) -> Void , completion: ( ( Error ? ) -> Void ) ? ) {
64
- performSteamingRequest ( request: JSONRequest < CompletionsResult > ( body: query. makeStreamable ( ) , url: buildURL ( path: . completions) ) , onResult: onResult, completion: completion)
64
+ performStreamingRequest ( request: JSONRequest < CompletionsResult > ( body: query. makeStreamable ( ) , url: buildURL ( path: . completions) ) , onResult: onResult, completion: completion)
65
65
}
66
66
67
67
public func images( query: ImagesQuery , completion: @escaping ( Result < ImagesResult , Error > ) -> Void ) {
@@ -85,7 +85,7 @@ final public class OpenAI: OpenAIProtocol {
85
85
}
86
86
87
87
public func chatsStream( query: ChatQuery , onResult: @escaping ( Result < ChatStreamResult , Error > ) -> Void , completion: ( ( Error ? ) -> Void ) ? ) {
88
- performSteamingRequest ( request: JSONRequest < ChatResult > ( body: query. makeStreamable ( ) , url: buildURL ( path: . chats) ) , onResult: onResult, completion: completion)
88
+ performStreamingRequest ( request: JSONRequest < ChatStreamResult > ( body: query. makeStreamable ( ) , url: buildURL ( path: . chats) ) , onResult: onResult, completion: completion)
89
89
}
90
90
91
91
public func edits( query: EditsQuery , completion: @escaping ( Result < EditsResult , Error > ) -> Void ) {
@@ -145,7 +145,7 @@ extension OpenAI {
145
145
}
146
146
}
147
147
148
- func performSteamingRequest < ResultType: Codable > ( request: any URLRequestBuildable , onResult: @escaping ( Result < ResultType , Error > ) -> Void , completion: ( ( Error ? ) -> Void ) ? ) {
148
+ func performStreamingRequest < ResultType: Codable > ( request: any URLRequestBuildable , onResult: @escaping ( Result < ResultType , Error > ) -> Void , completion: ( ( Error ? ) -> Void ) ? ) {
149
149
do {
150
150
let request = try request. build ( token: configuration. token,
151
151
organizationIdentifier: configuration. organizationIdentifier,
0 commit comments