Asteroid
Supervise Decorator
Wrap your agent tools in our decorator to enable supervision
The @supervise
decorator is a powerful feature that adds supervision functionality to your functions or tools. It allows you to:
- Enforce constraints and validations during function execution.
- Mock function responses for testing and development.
- Reuse previous execution logs to simulate tool responses.
Usage
You can use the @supervise
decorator to wrap your functions and specify supervision functions, mock policies, and responses.
Example
Here’s an example using the @supervise
decorator to supervise a function:
In this example, the send_email
function is supervised by an LLM supervisor, which checks the email content according to the provided policy, and a human supervisor for final approval.