openai
openai copied to clipboard
Got an exception when run on web
I got this exception when I run code on web. It works well when I run on Android.
_aiMessages.add(OpenAIChatCompletionChoiceMessageModel( content: [ OpenAIChatCompletionChoiceMessageContentItemModel.text(prompt), OpenAIChatCompletionChoiceMessageContentItemModel.fromMap( {'type': 'image_url', 'image_url': imageUri}) ], role: OpenAIChatMessageRole.user, ));
OpenAI API: https://platform.openai.com/docs/guides/vision
Error: ClientException: Failed to execute fetch: TypeError: Failed to fetch, uri=https://api.openai.com/v1/chat/completions
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 294:3 throw
packages/fetch_client/src/fetch_client.dart 127:7