modify method

MODIFY A MESSAGE WITHIN A THREAD

Implementation

Future<ThreadMessageModel?> modify(ThreadMessageModifyDataModel modifyData)async{
  Internet net = Internet();
  try{
    var data = {
      "metadata" : modifyData.metadata
    };
    var res = await net.openAIAssitant(data, "threads/${modifyData.threadId}/messages/${modifyData.messageId}", apiKey);

    if(res.statusCode == 200){
      var r = ThreadMessageModel.fromJson(jsonDecode(res.body));
      return r;
    }else{
      return null;
    }
  }catch(e){
    if (kDebugMode) {
      print(e.toString());
    }
    return null;
  }
}