Model.fromJson constructor

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

Implementation

factory Model.fromJson(Map<String, dynamic> json) {
  return Model(
    name: json['name'] ?? '',
    baseModelId: json['baseModelId'] ?? '',
    version: json['version'] ?? '',
    displayName: json['displayName'] ?? '',
    description: json['description'] ?? '',
    inputTokenLimit: json['inputTokenLimit'] ?? 0,
    outputTokenLimit: json['outputTokenLimit'] ?? 0,
    supportedGenerationMethods:
        decodeList(json['supportedGenerationMethods']) ?? [],
    temperature: decodeDouble(json['temperature']),
    maxTemperature: decodeDouble(json['maxTemperature']),
    topP: decodeDouble(json['topP']),
    topK: json['topK'],
    thinking: json['thinking'] ?? false,
  );
}