toJson method

  1. @override
Object toJson()
override

Implementation

@override
Object toJson() => {
  if (text != null) 'text': text,
  if (inlineData != null) 'inlineData': inlineData!.toJson(),
  if (functionCall != null) 'functionCall': functionCall!.toJson(),
  if (functionResponse != null)
    'functionResponse': functionResponse!.toJson(),
  if (fileData != null) 'fileData': fileData!.toJson(),
  if (executableCode != null) 'executableCode': executableCode!.toJson(),
  if (codeExecutionResult != null)
    'codeExecutionResult': codeExecutionResult!.toJson(),
  if (videoMetadata != null) 'videoMetadata': videoMetadata!.toJson(),
  if (thought.isNotDefault) 'thought': thought,
  if (thoughtSignature.isNotDefault)
    'thoughtSignature': encodeBytes(thoughtSignature),
  if (partMetadata != null) 'partMetadata': partMetadata!.toJson(),
};