toJson method

  1. @override
Object toJson()
override

Implementation

@override
Object toJson() {
  return {
    'model': model,
    if (systemInstruction != null)
      'systemInstruction': systemInstruction!.toJson(),
    'contents': encodeList(contents),
    if (tools.isNotDefault) 'tools': encodeList(tools),
    if (toolConfig != null) 'toolConfig': toolConfig!.toJson(),
    if (safetySettings.isNotDefault)
      'safetySettings': encodeList(safetySettings),
    if (generationConfig != null)
      'generationConfig': generationConfig!.toJson(),
    if (cachedContent != null) 'cachedContent': cachedContent,
  };
}