CountTextTokensResponse.fromJson constructor

CountTextTokensResponse.fromJson(
  1. Object? j
)

Implementation

factory CountTextTokensResponse.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return CountTextTokensResponse(
    tokenCount: switch (json['tokenCount']) {
      null => 0,
      Object $1 => decodeInt($1),
    },
  );
}