class LLMGuardRuntime(BaseRuntime):
A runtime that evaluates the risk level of functions using a language model.
Parameters:
GUARDPROMPT
)None
)False
)def __init__(
self,
prompt: str = GUARDPROMPT,
model: Optional[BaseModelBackend] = None,
verbose: bool = False
):
def add(
self,
funcs: Union[FunctionTool, List[FunctionTool]],
threshold: int = 2
):
Add a function or list of functions to the runtime.
Parameters:
2
)Returns:
LLMGuardRuntime: The current runtime.
def reset(self):
Resets the runtime to its initial state.