countTokens method

Implementation

Future<Resp.CountTokensResponse> countTokens(CountTokensRequest request) async {
  try {
    final response = await _dio.post(
      "$DOMAIN/${_fullModelName(model)}:countTokens",
      data: request.toJson(),
      options: _createCommonOptions(),
    );
    _validateResponse(response);
    return Resp.CountTokensResponse.fromJson(response.data);
  } catch (error) {
    rethrow;
  }
}