send_instruction()
call.send_instruction(instruction) sends a real-time instruction to the agent without changing the current task. Use it for context injection and behavioral nudges.
Signature
signature
call.send_instruction(instruction: str) -> None| Parameter | Type | Default | Description |
|---|---|---|---|
| instruction | str | — | A real-time instruction to pass to the agent. Does not change the current task. |
Return value: None / Promise<void>
Example
example.py
@agent.on_task_complete("collect_order_id")
def on_order_id_collected(call: guava.Call):
order = lookup_order(call.get_field("order_id"))
call.send_instruction(
f"Order #{order['id']} is {order['status']} "
f"with an estimated delivery of {order['eta']}. "
f"Share this with the caller naturally."
)Tip: Unlike call.set_task(), call.send_instruction() doesn't replace the agent's current objective. Use it to inject context or steer behavior mid-conversation — for example, after a database lookup reveals something the agent should know.
Questions? hi@goguava.ai
@agent.on_task_complete("collect_order_id")
def on_order_id_collected(call: guava.Call):
order = lookup_order(call.get_field("order_id"))
call.send_instruction(
f"Order #{order['id']} is {order['status']} "
f"with an estimated delivery of {order['eta']}. "
f"Share this with the caller naturally."
)