dylanshine / openai-kit

A community Swift package used to interact with the OpenAI API
https://platform.openai.com/docs/api-reference
MIT License
703 stars 109 forks source link

[] nw_http_connect_process_response [C10.1.1:2] http connect Proxy received status: HTTP/1.1 503 Service Unavailable #25

Closed crazypoo closed 1 year ago

crazypoo commented 1 year ago

Hello friend ,i dont know what can i do,when api throw this error

dylanshine commented 1 year ago

@crazypoo Can you provide steps in order to recreate this error?

crazypoo commented 1 year ago

Task.init { do { PTNSLogConsole("sending") let completion = try await self.openAI_Kit.images.createVariation(image: object.pngData()!,n:AppDelegate.appDelegate()!.appConfig.getImageCount,size: imageSizeType) await MainActor.run { self.setTypingIndicatorViewHidden(true) PTNSLogConsole(">>>>>>>>(String(describing: completion.data))") self.receivedImage(urlArr: completion.data, saveModel: saveModel, sendIndex: (self.messageList.count - 1)) PTNSLogConsole("sendEnd") } } catch let error as APIErrorResponse { self.setTypingIndicatorViewHidden(true) PTNSLogConsole("send(error.localizedDescription)") } } just this ,when my network no working, api will show the "[] nw_http_connect_process_response [C10.1.1:2] http connect Proxy received status: HTTP/1.1 503 Service Unavailable " log,but catch error no throw something,so i dont know how to do next step

sulsanaul commented 1 year ago

You may have to add entitlements for com.apple.security.network.client or com.apple.security.network.server. Or disable the sandbox entitlement if you're not distributing your app on the app store.

dylanshine commented 1 year ago

Marking as closed to lack of discussion