Part.fromJson constructor

Part.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Part.fromJson(Map<String, dynamic> json) {
  return Part(
    text: json['text'],
    inlineData: decode(json['inlineData'], Blob.fromJson),
    functionCall: decode(json['functionCall'], FunctionCall.fromJson),
    functionResponse: decode(
      json['functionResponse'],
      FunctionResponse.fromJson,
    ),
    fileData: decode(json['fileData'], FileData.fromJson),
    executableCode: decode(json['executableCode'], ExecutableCode.fromJson),
    codeExecutionResult: decode(
      json['codeExecutionResult'],
      CodeExecutionResult.fromJson,
    ),
    videoMetadata: decode(json['videoMetadata'], VideoMetadata.fromJson),
    thought: json['thought'] ?? false,
    thoughtSignature: decodeBytes(json['thoughtSignature']),
    partMetadata: decodeCustom(json['partMetadata'], Struct.fromJson),
  );
}