openai icon indicating copy to clipboard operation
openai copied to clipboard

Got an exception when run on web

Open hnvmeta opened this issue 1 year ago • 0 comments

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

hnvmeta avatar Jan 19 '24 07:01 hnvmeta