Shield Decorators
Reference for Python Shield decorators, including prompt, tool, tool response, model response, and generic wrappers.
from highflame import Highflame
from highflame.shield import Shield
client = Highflame(api_key="hf_sk_...")
shield = Shield(client)@shield.prompt
@shield.prompt# Bare decorator — defaults apply
@shield.prompt
def chat(message: str) -> str:
return llm.complete(message)
# With options
@shield.prompt(mode="monitor", content_arg="user_input", session_id="sess_abc")
def chat(context: str, user_input: str) -> str:
return llm.complete(user_input)Option
Type
Default
Description
@shield.tool
@shield.toolOption
Type
Default
Description
@shield.toolresponse
@shield.toolresponseOption
Type
Default
Description
@shield.modelresponse
@shield.modelresponseOption
Type
Default
Description
@shield() Generic Decorator
@shield() Generic DecoratorOption
Type
Default
Description
Related Topics
Last updated