anasfik / openai

Dart/Flutter SDK for ChatGPT and all OpenAI APIs (GPT, Dall-e..)
https://pub.dev/packages/dart_openai
MIT License
593 stars 186 forks source link

fix(model): image_url changed to object from string as specified in OpenAI API spec #198

Open MbBrainz opened 1 month ago

MbBrainz commented 1 month ago

I noticed the request Exception below and went searching.

As discussed in the openai community forum here The image_url should be an object and not a string. In the current implementation, the image_url will be set as a string and this will always result in the following response from the openai api:

RequestFailedException(message: Invalid type for 'messages[1].content[0].image_url': expected an object, but got a string instead

In the forum discussion, it is mentioned that the api specs were outdated, but its not anymore as specified under the image tab at the openai chat completion api spec

MbBrainz commented 1 month ago

@anasfik @signmotion

MbBrainz commented 1 month ago

Fixes #191