索引
用于按用户存储聊天记录的基础接口类。
基础聊天存储 #
基类:EventBaseComponent
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
class_name
classmethod
#
class_name() -> str
获取类名。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
12 13 14 15 | |
set_messages
abstractmethod
#
set_messages(key: str, messages: List[ChatMessage]) -> None
为某个键设置消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
17 18 19 20 | |
get_messages
abstractmethod
#
get_messages(key: str) -> List[ChatMessage]
获取指定键的消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
22 23 24 25 | |
add_message
abstractmethod
#
add_message(key: str, message: ChatMessage) -> None
为某个键添加一条消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
27 28 29 30 | |
delete_messages
abstractmethod
#
delete_messages(key: str) -> Optional[List[ChatMessage]]
删除某个键的消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
32 33 34 35 | |
delete_message
abstractmethod
#
delete_message(key: str, idx: int) -> Optional[ChatMessage]
删除特定键对应的消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
37 38 39 40 | |
delete_last_message
abstractmethod
#
delete_last_message(key: str) -> Optional[ChatMessage]
删除某个键的最后一条消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
42 43 44 45 | |
get_keys
abstractmethod
#
get_keys() -> List[str]
获取所有键。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
47 48 49 50 | |
aset_messages
async
#
aset_messages(key: str, messages: List[ChatMessage]) -> None
异步版本:根据键获取消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
52 53 54 | |
aget_messages
async
#
aget_messages(key: str) -> List[ChatMessage]
异步版本:根据键获取消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
56 57 58 | |
async_add_message
async
#
async_add_message(key: str, message: ChatMessage) -> None
异步版本的为某个键添加消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
60 61 62 | |
adelete_messages
async
#
adelete_messages(key: str) -> Optional[List[ChatMessage]]
异步版本:根据键删除消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
64 65 66 | |
adelete_message
async
#
adelete_message(key: str, idx: int) -> Optional[ChatMessage]
异步版本:根据键删除特定消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
68 69 70 | |
adelete_last_message
async
#
adelete_last_message(key: str) -> Optional[ChatMessage]
异步版本:根据键删除最后一条消息。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
72 73 74 | |
aget_keys
async
#
aget_keys() -> List[str]
获取所有键的异步版本。
workflows/handler.py 中的源代码llama_index/core/storage/chat_store/base.py
76 77 78 | |
选项: 成员:- BaseChatStore