dylanshine / openai-kit

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

request handler error #21

Closed halpz closed 1 year ago

halpz commented 1 year ago

It seems the response object is not mapping to the codable 'Completion' object properly:

I'm getting this error:

keyNotFound(CodingKeys(stringValue: "id", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"id\", intValue: nil) (\"id\").", underlyingError: nil))

halpz commented 1 year ago

maybe something has changed with the response object data structure?

actow commented 1 year ago

Getting the same error here.

dylanshine commented 1 year ago

So you're getting a response back without an ID I see...

dylanshine commented 1 year ago

Maybe something has changed, let me take a look...

dylanshine commented 1 year ago

@halpz Can you give me your input so I can try to reproduce?

nathaniel11 commented 1 year ago

this is actually what happens when you are getting a error model returned. It tries to parse it into success model, fails and print the parsing error message.

roddymunro commented 1 year ago

Seeing the same issue - see my comment in the other issue: https://github.com/dylanshine/openai-kit/issues/22#issuecomment-1474626158

dylanshine commented 1 year ago

This is caused by a rogue print statement, will remove shortly.