anasfik/openai

imageUrl Doesn't Work

marc-wilson opened this issue · 3 comments

OpenAIChatCompletionChoiceMessageContentItemModel.imageUrl(<url>) does not work. Always throughs an 'invalid message content, see platform docs' message.

#144 seems like it may fix it.

Thank you mentioning this, it is fixed.

It still doenst work. But theres another error now. I tried even using te example code of the README.md

it returns this error:
[OpenAI] an error occurred, throwing exception: RequestFailedException(message: Invalid type for 'messages[0].content[1].image_url': expected an object, but got a string instead., statusCode: 400)

thats it or im making some pretty rookie mistake

@RafaelFleury FWIW this library is kind of pointless if you're familiar with Open API/Swagger. OpenAI provides an Open API spec so you can just generate a dart client from that.

The only downside is that in order for it to be generated with dart 3, we need this PR to be merged: OpenAPITools/openapi-generator#18001

I ended up just creating a node api using the open ai client on npm. Might leverage the generated client when the open api dart 3 generator is supported.