Spaces:
Running
Running
Download plugins/_memory/api/knowledge_reindex.py from Leon4gr45/openoperator: direct link, hf CLI and curl.
- Browser
- Download file 612 Bytes
-
https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/plugins/_memory/api/knowledge_reindex.py
- Command line
-
hf download hf://spaces/Leon4gr45/openoperator/plugins/_memory/api/knowledge_reindex.py
-
curl -L -o knowledge_reindex.py https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/plugins/_memory/api/knowledge_reindex.py
612 Bytes
| from helpers.api import ApiHandler, Request, Response | |
| from plugins._memory.helpers.memory import Memory | |
| class ReindexKnowledge(ApiHandler): | |
| async def process(self, input: dict, request: Request) -> dict | Response: | |
| ctxid = input.get("ctxid", "") | |
| if not ctxid: | |
| raise Exception("No context id provided") | |
| context = self.use_context(ctxid) | |
| # reload memory to re-import knowledge | |
| await Memory.reload(context.agent0) | |
| context.log.set_initial_progress() | |
| return { | |
| "ok": True, | |
| "message": "Knowledge re-indexed", | |
| } | |