We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
You can't actually call the image.create if you choose the b64 response :
final response = await OpenAI.instance.image.create( prompt: prompt, n: 1, size: OpenAIImageSize.size256, responseFormat: OpenAIImageResponseFormat.b64Json, );
When you do you get this exception
Unhandled exception: type 'Null' is not a subtype of type 'String' #0 new OpenAIImageData.fromMap (package:dart_openai/src/core/models/image/image/sub_models/data.dart:18:37) #1 new OpenAIImageModel.fromMap.<anonymous closure> (package:dart_openai/src/core/models/image/image/image.dart:29:39) #2 MappedListIterable.elementAt (dart:_internal/iterable.dart:415:31) #3 ListIterator.moveNext (dart:_internal/iterable.dart:344:26) #4 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:189:27) #5 new _GrowableList.of (dart:core-patch/growable_array.dart:150:28) #6 new List.of (dart:core-patch/array_patch.dart:52:28) #7 ListIterable.toList (dart:_internal/iterable.dart:214:7) #8 new OpenAIImageModel.fromMap (package:dart_openai/src/core/models/image/image/image.dart:30:12) #9 OpenAIImages.create.<anonymous closure> (package:dart_openai/src/instance/images/images.dart:72:45) #10 OpenAINetworkingClient.post (package:dart_openai/src/core/networking/client.dart:130:23) <asynchronous suspension> #11 OpenAIImages.create (package:dart_openai/src/instance/images/images.dart:70:12) <asynchronous suspension> #12 requestImg (package:gpt_api/gpt_api.dart:45:20) <asynchronous suspension> #13 generateFicheImages (file:///Users/rxlabz/projects/lilu/lilu023/protos/gpt_api/bin/gpt_api.dart:108:25) <asynchronous suspension> #14 saveLesson (file:///Users/rxlabz/projects/lilu/lilu023/protos/gpt_api/bin/gpt_api.dart:69:5) <asynchronous suspension> #15 main (file:///Users/rxlabz/projects/lilu/lilu023/protos/gpt_api/bin/gpt_api.dart:36:3) <asynchronous suspension>
It's because the OpenAIImageData constructor wait for a non nullable url, and not for the b64json data.
OpenAIImageData
The text was updated successfully, but these errors were encountered:
fix anasfik#31 - OpenAIImageData from b64Json
71981b5
allow instantiate from a OpenAIImageResponseFormat.b64Json response
Thank you for the notice!
Sorry, something went wrong.
Merge pull request #32 from rxlabz/patch-1
44cb887
fix #31 - OpenAIImageData from b64Json
No branches or pull requests
You can't actually call the image.create if you choose the b64 response :
When you do you get this exception
It's because the
OpenAIImageData
constructor wait for a non nullable url, and not for the b64json data.The text was updated successfully, but these errors were encountered: