Spaces:
Paused
Paused
ehl0wr0ld
Rafael Uzarowski
feat: make agentcontexttype background invisible to user (#653)
00ae9f2 unverified Download python/extensions/message_loop_end/_90_save_chat.py from OnyxMunk/GravityFalls: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/spaces/OnyxMunk/GravityFalls/resolve/main/python/extensions/message_loop_end/_90_save_chat.py
- Command line
-
hf download hf://spaces/OnyxMunk/GravityFalls/python/extensions/message_loop_end/_90_save_chat.py
-
curl -L -o _90_save_chat.py https://huggingface.co/spaces/OnyxMunk/GravityFalls/resolve/main/python/extensions/message_loop_end/_90_save_chat.py
446 Bytes
| from python.helpers.extension import Extension | |
| from agent import LoopData, AgentContextType | |
| from python.helpers import persist_chat | |
| class SaveChat(Extension): | |
| async def execute(self, loop_data: LoopData = LoopData(), **kwargs): | |
| # Skip saving BACKGROUND contexts as they should be ephemeral | |
| if self.agent.context.type == AgentContextType.BACKGROUND: | |
| return | |
| persist_chat.save_tmp_chat(self.agent.context) | |