Skip to content

AI

Bookable uses AI across several features to reduce the manual work involved in configuring the platform. The primary surface is action authoring: describe what should happen when a trigger fires and the AI produces a complete, ready to save action draft without writing Tengo by hand.

Action generation

Send a prompt describing the behavior you want and the generator returns a complete action draft: a name, a description, a chosen trigger, the Tengo script body, and the booleans that control how the action runs. The draft is not saved automatically. Review it, edit it, then post it to POST /action to make it live.

Code refinement

When the structure of an action is already right but the script needs to change, the refinement generator takes the existing summary, the existing script, the trigger it was written for, and a new instruction. It returns a rewritten script with an updated summary, leaving everything else untouched.

Progress streaming

Both generators run inline and return when the model finishes. To watch progress while a run is in flight, fetch the request with Accept: text/event-stream. The server emits Server Sent Events carrying status and progress until the run settles. The same endpoint without the SSE header returns the current state as JSON.

Audit trail

Every generator call is logged with the prompt, the model used, a progress percentage, a status that moves from processing to succeeded or failed, and the model response. The request_id returned alongside the draft is the identifier for that log entry.

Examples

API

The AI tag covers action generation, code refinement, request reads and the SSE progress stream.