adamrushy / OpenAISwift

This is a wrapper library around the ChatGPT and OpenAI HTTP API
MIT License
1.6k stars 242 forks source link

"The operation couldn’t be completed. (OpenAISwift.OpenAIError error 2.)" #110

Open matanstau opened 11 months ago

matanstau commented 11 months ago

I'm getting this error after updating to 1.4.0. "The operation couldn’t be completed. (OpenAISwift.OpenAIError error 2.)"

Seems like other people are getting it as well https://github.com/adamrushy/OpenAISwift/issues/109

laszlotuss commented 10 months ago

They made ChatMessage Identifiable, which combined with Codable protocol will encode the local id property to the body and OpenAI rejects it:

"message = "Additional properties are not allowed ('id' was unexpected) - 'messages.0'"
    type = "invalid_request_error""
laszlotuss commented 10 months ago

I fixed it and made a Pull Request #114