openai icon indicating copy to clipboard operation
openai copied to clipboard

(dart_openai 5.1.0) Broken `OpenAIChatCompletionChoiceMessageContentItemModel.imageUrl`

Open gmpassos opened this issue 1 year ago • 10 comments
trafficstars

The latest published version (dart_openai: 5.1.0) is incompatible with the API due to an invalid JSON payload for a chat completion message with content of type "image_url".

It appears that this bug has already been fixed in the current main branch: https://github.com/anasfik/openai/blob/650ffbf93961962fec1554ba817c07d9700e2002/lib/src/core/models/chat/sub_models/choices/sub_models/sub_models/content.dart#L74

Could you please publish a new version? Best regards.

If you need any help with this package, let me know.

gmpassos avatar Aug 23 '24 03:08 gmpassos

FYI @anasfik

gmpassos avatar Aug 23 '24 03:08 gmpassos

Yup. Same issue. When are you planning on pushing this fix out?

Intelliabb avatar Aug 27 '24 16:08 Intelliabb

Any update on this or work around?

Muzammil-Bit avatar Aug 31 '24 07:08 Muzammil-Bit

Use openai_dart package instead. It's aligned with the latest OpenAI API.

franboladoruiz avatar Aug 31 '24 09:08 franboladoruiz

@anasfik any update?

gmpassos avatar Sep 20 '24 06:09 gmpassos

Ive created a fix and pr for this here: https://github.com/anasfik/openai/pull/198

MbBrainz avatar Oct 01 '24 11:10 MbBrainz

I think you guys should depricate this package in favor of this @franboladoruiz @franboladoruiz

Use openai_dart package instead. It's aligned with the latest OpenAI API.

MbBrainz avatar Oct 04 '24 08:10 MbBrainz

I am not sure why OpenAI only lists the dart_openai package in their Community Libraries section. I guess a lot of people like me start using dart_openai because of this, only to find out later that it's not aligned with the latest API, and then have to migrate the integration to openai_dart.

franboladoruiz avatar Oct 04 '24 11:10 franboladoruiz

https://github.com/anasfik/openai/pull/198 is correct fix. @anasfik you should merge it and release it as new version.

hukumsingh87 avatar Oct 24 '24 05:10 hukumsingh87

It's sad to see big packages that aren't well maintained.

now i got this error and have 2 options,

1 is to switch to another package like guys suggests above, this way changes the code quite a lot

Way 2 is I see the lib is license MIT

i am thinking to maintain a new package open ai new by remote new repo with full old commits of previous authors and Integrate the latest update

what do you guys think ? @gmpassos @hukumsingh87 @MbBrainz @Muzammil-Bit @franboladoruiz

ChunhThanhDe avatar Mar 06 '25 08:03 ChunhThanhDe

@ChunhThanhDe I think there are other similar packages available that are well maintained and are being updated regularly. You should switch to them.

Muzammil-Bit avatar Jun 24 '25 09:06 Muzammil-Bit

Thanks to the community and you.

Resolved a while ago, please update to latest versions.

anasfik avatar Nov 08 '25 23:11 anasfik