chat_gpt_sdk icon indicating copy to clipboard operation
chat_gpt_sdk copied to clipboard

Picture Upload Planned?

Open hanchao2407 opened this issue 1 year ago • 5 comments

hanchao2407 avatar Nov 12 '23 21:11 hanchao2407

comingsoon @hanchao2407

redevrx avatar Nov 13 '23 04:11 redevrx

any progress on this?

hanchao2407 avatar Nov 26 '23 16:11 hanchao2407

@hanchao2407 you can description more for this issue ?

redevrx avatar Feb 26 '24 02:02 redevrx

No plans for this?

BernardinD avatar May 20 '24 07:05 BernardinD

@BernardinD @hanchao2407

  void chatComplete() async {
  final request = UploadFile(file: FileInfo('file-path', 'file-name'),purpose: 'image');
  final fileResponse = await openAI.file.uploadFile(request);
  print(fileResponse );


    final request = ChatCompleteText(messages: [
      Map.of({"role": "system", "content": "You are a helpful assistant."}),
     Map.of({"role": "user", "content": "Please analyze the uploaded image with file ID: ${fileResponse.id}"})
    ], maxToken: 200, model: Gpt4ChatModel());

    final response = await openAI.onChatCompletion(request: request);
    for (var element in response!.choices) {
      print("data -> ${element.message?.content}");
    }
  }

redevrx avatar May 20 '24 08:05 redevrx