CountTextTokensRequest.fromJson constructor

CountTextTokensRequest.fromJson(
  1. Object? j
)

Implementation

factory CountTextTokensRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return CountTextTokensRequest(
    model: switch (json['model']) {
      null => '',
      Object $1 => decodeString($1),
    },
    prompt: switch (json['prompt']) {
      null => null,
      Object $1 => TextPrompt.fromJson($1),
    },
  );
}