Index
BaseMemory #
Bases: BaseComponent
Base class for all memory types.
NOTE: The interface for memory is not yet finalized and is subject to change.
Source code in llama-index-core/llama_index/core/memory/types.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
class_name
classmethod
#
class_name() -> str
Get class name.
Source code in llama-index-core/llama_index/core/memory/types.py
17 18 19 20 |
|
from_defaults
abstractmethod
classmethod
#
from_defaults(chat_history: Optional[List[ChatMessage]] = None, llm: Optional[LLM] = None) -> BaseMemory
Create a chat memory from defaults.
Source code in llama-index-core/llama_index/core/memory/types.py
22 23 24 25 26 27 28 29 |
|
get
abstractmethod
#
get(**kwargs: Any) -> List[ChatMessage]
Get chat history.
Source code in llama-index-core/llama_index/core/memory/types.py
31 32 33 |
|
get_all
abstractmethod
#
get_all() -> List[ChatMessage]
Get all chat history.
Source code in llama-index-core/llama_index/core/memory/types.py
35 36 37 |
|
put
abstractmethod
#
put(message: ChatMessage) -> None
Put chat history.
Source code in llama-index-core/llama_index/core/memory/types.py
39 40 41 |
|
set
abstractmethod
#
set(messages: List[ChatMessage]) -> None
Set chat history.
Source code in llama-index-core/llama_index/core/memory/types.py
43 44 45 |
|
reset
abstractmethod
#
reset() -> None
Reset chat history.
Source code in llama-index-core/llama_index/core/memory/types.py
47 48 49 |
|