Usage.fromJson constructor

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

Creates a Usage from a JSON map.

Implementation

factory Usage.fromJson(Map<String, dynamic> json) => Usage(
      promptTokens: json['prompt_tokens'] as int,
      completionTokens: json['completion_tokens'] as int,
      totalTokens: json['total_tokens'] as int,
    );