mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 22:14:28 +01:00
Make input and additionalInput optional in StepRequestBody
Updated the StepRequestBody class to allow both 'input' and 'additionalInput' to be optional. Added logic in toJson() method to return an empty JSON object if both fields are null.
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
class StepRequestBody {
|
||||
final String input;
|
||||
final String? input;
|
||||
final Map<String, dynamic>? additionalInput;
|
||||
|
||||
StepRequestBody({required this.input, this.additionalInput});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
if (input == null && additionalInput == null) {
|
||||
return {};
|
||||
}
|
||||
return {'input': input, 'additional_input': additionalInput};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user