toJson method

  1. @override
Map<String, dynamic> toJson()
override

Converts to JSON.

Implementation

@override
Map<String, dynamic> toJson() => {
  'type': 'file_search',
  if (maxNumResults != null || rankingOptions != null)
    'file_search': {
      if (maxNumResults != null) 'max_num_results': maxNumResults,
      if (rankingOptions != null) 'ranking_options': rankingOptions!.toJson(),
    },
};