Hello, I have been trying to use the API for several days but I have no response. I checked my settings (subscription, key, etc.) but no response to my Query.
My code in SwiftUI :
openAI.sendCompletion(with: query, maxTokens: 500) { result in
DispatchQueue.main.async {
switch result {
case .success(let success):
if let chatGPTResponse = success.choices?.first?.text {
self.answers.append(chatGPTResponse)
print("Response received: \(chatGPTResponse)")
} else {
print("No text in response")
}
case .failure(let failure):
print("Error: \(failure.localizedDescription)")
}
}
}