mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-30 12:40:33 +00:00
BIG PYTHON REFACTOR
Python scripts moved out of python/ folder to root to be unified with plugins + frontend extension around api calls
This commit is contained in:
parent
f94b7d742c
commit
d02dda3667
326 changed files with 1096 additions and 862 deletions
0
extensions/python/util_model_call_before/.gitkeep
Normal file
0
extensions/python/util_model_call_before/.gitkeep
Normal file
20
extensions/python/util_model_call_before/_10_mask_secrets.py
Normal file
20
extensions/python/util_model_call_before/_10_mask_secrets.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from helpers.extension import Extension
|
||||
from helpers.secrets import get_secrets_manager
|
||||
|
||||
|
||||
class MaskToolSecrets(Extension):
|
||||
|
||||
async def execute(self, **kwargs):
|
||||
if not self.agent:
|
||||
return
|
||||
|
||||
# model call data
|
||||
call_data:dict = kwargs.get("call_data", {})
|
||||
|
||||
secrets_mgr = get_secrets_manager(self.agent.context)
|
||||
|
||||
# mask system and user message
|
||||
if system:=call_data.get("system"):
|
||||
call_data["system"] = secrets_mgr.mask_values(system)
|
||||
if message:=call_data.get("message"):
|
||||
call_data["message"] = secrets_mgr.mask_values(message)
|
||||
Loading…
Add table
Add a link
Reference in a new issue