fromJson static method

RealtimeTool fromJson(
  1. Map<String, dynamic> j
)

Implementation

static RealtimeTool fromJson(Map<String, dynamic> j) {
  return switch (j["type"]) {
    "mcp" => RealtimeMcpTool.fromJson(j),
    "function" => RealtimeFunctionTool.fromJson(j),
    _ => throw ArgumentError("unexpected tool type ${j['type']}"),
  };
}