CachedChatModel class
A ChatModel that consults a SemanticCache before calling the model.
The cache key is the whole rendered conversation, so only a conversation that says the same thing hits — typically a first question.
- Implemented types
Constructors
- CachedChatModel(ChatModel inner, SemanticCache cache)
-
Wraps
inner.
Properties
- cache → SemanticCache
-
The cache.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- inner → ChatModel
-
The model called on a miss.
final
- model → String
-
Model identifier sent to the provider.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void -
Releases network resources.
override
-
complete(
List< ChatMessage> messages, {String? system, int? maxTokens}) → Future<ChatResponse> -
Generates a complete response to
messages.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
stream(
List< ChatMessage> messages, {String? system, int? maxTokens}) → Stream<String> -
Streams the response to
messagesas text deltas.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited