Response options are built on the ResponseOption model:
Copy
Ask AI
from humanlayer import ResponseOptionoptions = [ ResponseOption( name="reject", description="Reject the message", prompt_fill="try again but this time ", # Optional pre-filled text ), ResponseOption( name="skip", title="Skip it", # Optional display title description="Skip this operation", prompt_fill="skip this and move on to the next task ", ),]
You can add response options to any function that requires approval:
Copy
Ask AI
@hl.require_approval( contact_channel=dm_with_ceo, reject_options=[ ResponseOption( name="reject", description="Reject the message", prompt_fill="try again but this time ", ), ResponseOption( name="skip", title="Skip it", description="Skip this operation", prompt_fill="skip this and move on to the next task ", ), ],)def send_linkedin_message(thread_id: str, to_name: str, msg: str) -> str: """send a message in a thread in LinkedIn""" return f"message successfully sent to {to_name}"