getCacheKey method

  1. @override
String getCacheKey(
  1. Iterable<ChatMessage> messages,
  2. ChatOptions? options
)
override

Gets a cache key for the given messages and options.

Override to customize cache key generation.

Implementation

@override
String getCacheKey(Iterable<ChatMessage> messages, ChatOptions? options) {
  final buffer = StringBuffer(super.getCacheKey(messages, options));
  for (final key in _cachingKeys) {
    buffer.write('|$key');
  }
  return buffer.toString();
}