toJson method

  1. @override
Object toJson()
override

Implementation

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