AiModel.fromJson constructor
AiModel.fromJson(
- Map<String, dynamic> json
)
Implementation
factory AiModel.fromJson(Map<String, dynamic> json) => AiModel(
id: json["id"] ?? "",
aiVendorId: json["aiVendorId"] ?? "",
name: json["name"] ?? "",
cost: json["cost"] ?? "",
includedK: json["includedK"] ?? "",
costExtraK: json["costExtraK"] ?? "",
frontier: json["frontier"] ?? false,
legacy: json["legacy"] ?? false,
canUseTools: json["functionCalling"] ?? false,
capabilities: json["capabilities"] != null
? (json["capabilities"] is List
? List<String>.from(
(json["capabilities"] as List)
.where((x) => x != null)
.map((x) => x.toString()))
: [])
: [],
vendor:
json["vendor"] != null ? AiVendor.fromJson(json["vendor"]) : null,
);