class TaskRequestBody { final String input; final Map? additionalInput; TaskRequestBody({required this.input, this.additionalInput}); Map toJson() { Map result = {'input': input, 'additional_input': additionalInput}; result.removeWhere((_, v) => v == null); return result; } }