Runnable example in
examples/langchain/, a
GPT-powered chat agent with approvals, selections, and forms via WebSocket.Overview
Placet integrates with LangChain as a human-in-the-loop tool. Your LangChain agent receives messages in real-time via WebSocket and can send replies, request approvals, present selections, or ask the user to fill in forms, all rendered natively in the Placet UI. The agent uses four tools:| Tool | Description | Blocking |
|---|---|---|
send_message | Send a one-way message (status update, reply) | No |
ask_approval | Approve / Reject buttons | Yes |
ask_selection | Pick one option from a list | Yes |
ask_form | Fill in a multi-field form | Yes |
review:responded event (up to 5
minutes).
Message Helper
All tools post messages through the same helper:Tools
send_message
Fire-and-forget: sends a message and returns immediately:ask_approval
Shows Approve / Reject buttons. Blocks until the user clicks one:ask_selection
Presents a list of options for the user to pick from:ask_form
Shows a form with input fields:Waiting for Reviews via WebSocket
The blocking tools above callwait_review(), which uses a threading.Event that gets set when
the WebSocket delivers the review:responded event for the corresponding message:
_review_results and signals the event:
