fromJson static method

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

Implementation

static AgentInputContent fromJson(Map<String, dynamic> json) {
  switch (json['type']) {
    case 'text':
      return AgentTextContent.fromJson(json);
    case 'file':
      return AgentFileContent.fromJson(json);
  }
  throw ArgumentError.value(json['type'], 'json[type]', 'unsupported agent input content type');
}