submitToolOutput method

Future<RunToolOutputModel?> submitToolOutput(
  1. ToolInputData toolData
)

PARSE RUN TOOL OUTPUT MODEL

Implementation

Future<RunToolOutputModel?> submitToolOutput(ToolInputData toolData)async{
  Internet net = Internet();
  List<Map> data = [];
  try{
    var res = await net.openAIAssitant(jsonDecode(data.toString()), "threads/${toolData.threadId}/runs/${toolData.runId}/submit_tool_outputs", apiKey);

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