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

Changed JSON Syntax for imageUrls to have a object instead of a String. #171

Closed Mia-Ameisbichler closed 6 months ago

Mia-Ameisbichler commented 7 months ago

When constructing a message using the OpenAIChatCompletionChoiceMessageContentItemModel.imageUrl constructor the JSON is built wrong. Image Requests require a JSON object for imageUrl not a String.

The JSON should have this format: imageUrl: {url: 'imageUrl'} not imageUrl: 'imageUrl'.

I guess there might be an existing solution/workaround for this, or they changed the API syntax, but this is the solution that worked for me.

Tameflame commented 6 months ago

This commit causes compile errors for me. Looks like missing commas? @anasfik