BaseMemory class abstract interface

Base interface for memory in chains.

Memory refers to state in Chains. Memory can be used to store information about past executions of a Chain and inject that information into the inputs of future executions of the Chain. For example, for conversational Chains Memory can be used to store conversations and automatically add them to future model prompts so that the model has the necessary context to respond coherently to the latest input.

Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
memoryKeys Set<String>
Input keys this memory class will load dynamically to the prompt.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() Future<void>
Clear memory contents.
loadMemoryVariables([MemoryInputValues values = const {}]) Future<MemoryVariables>
Returns key-value pairs given the MemoryInputValues.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
saveContext({required MemoryInputValues inputValues, required MemoryOutputValues outputValues}) Future<void>
Save the context of this model run to memory.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

defaultMemoryKey → const String
Default memory key.