btfranklin/CleverBird

Response status code was unacceptable: 404

colbyn opened this issue · 5 comments

colbyn commented

The following

let openAIAPIConnection = OpenAIAPIConnection(apiKey: CHATGPT_API_KEY)
let chatThread = ChatThread(connection: openAIAPIConnection)
    .addSystemMessage("You are a helpful assistant.")
    .addUserMessage("Who won the world series in 2020?")
let completion = try! await chatThread.complete()
print(completion)

Fails at runtime with the following message:

Fatal error: 'try!' expression unexpectedly raised an error: CleverBird.CleverBirdError.requestFailed(message: "Response status code was unacceptable: 404.")

I have yet to determine if it's me or the library.

colbyn commented

Using the .gpt35Turbo model I get

CleverBird.CleverBirdError.requestFailed(message: "Response status code was unacceptable: 429.")

The 429 response code is described thusly: The HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time ("rate limiting")

That makes me think it's something on your side. Please let me know if you're unable to resolve this problem after waiting a bit. You might want to log into your OpenAI account and look at the "usage" tab to see what's going on.

colbyn commented

@btfranklin Yeah you may be right. I'll post any updates I encounter.

@colbyn Did you resolve this? If not, do you have any additional information?

Closed this issue since I assume it has been resolved. Please feel free to re-open if the problem happens again.