getTokenCount method

  1. @override
Future<int> getTokenCount(
  1. ConversationHandle conversation
)
override

Implementation

@override
Future<int> getTokenCount(ConversationHandle conversation) async {
  final handle = conversation as _WebConversationHandle;
  final tokenCount = await _promiseToFuture<JSNumber>(
    handle.conversation.callMethod<JSPromise<JSNumber>>('getTokenCount'.toJS),
  );
  return tokenCount.toDartInt;
}