mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-28 19:51:11 +00:00
Add extensible decorator and cache controls
Introduce an extensible extension point system and finer cache control. Added extensible decorator in python/helpers/extension.py to wrap sync/async functions, emit start/end extension points, detect Agent instances, and allow extensions to modify inputs/results/exceptions. Reworked extension loading to use the cache API and a dedicated cache area. Enhanced python/helpers/cache.py with global and per-area toggles and early-return behavior in add/get/remove. Updated API handler caching (python/helpers/api.py) to use the cache area toggle and simplify cache logic. Marked several initialization functions as @extension.extensible in initialize.py. Moved nest_asyncio.apply() from agent.py into python/helpers/runtime.py to ensure the event loop patch is applied at runtime initialization. Also applied small typing/formatting tweaks and path handling improvements.
This commit is contained in:
parent
777901744c
commit
d82b121bc9
6 changed files with 169 additions and 24 deletions
|
|
@ -8,6 +8,9 @@ import asyncio
|
|||
import threading
|
||||
import queue
|
||||
import sys
|
||||
import nest_asyncio
|
||||
|
||||
nest_asyncio.apply()
|
||||
|
||||
T = TypeVar("T")
|
||||
R = TypeVar("R")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue