Message.fromJson constructor

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

Implementation

factory Message.fromJson(Map<String, dynamic> json) => Message(
  id: json["id"],
  object: json["object"],
  createdAt: json["created_at"],
  threadId: json["thread_id"],
  role: json["role"],
  content: List<Content>.from(json["content"].map((x) => Content.fromJson(x))),
  fileIds: List<String>.from(json["file_ids"].map((x) => x)),
  assistantId: json["assistant_id"],
  runId: json["run_id"],
  metadata: Metadata.fromJson(json["metadata"]),
);