RawtohRawtoh/Docs
Documentation

AI

Describe what should happen and let Rawtoh write the triggers and actions — or ask for a change right inside the editor.

Rawtoh can write your scripts for you. There are two ways to use it: an automation turns one prompt into a complete set of triggers and actions, and the AI assist edits the script you have open. Either way the result is ordinary TypeScript — you can read it, edit it by hand, and debug it like any other script.

Automations

An automation is a prompt plus everything Rawtoh generated from it. You explain what should happen and when; Rawtoh works out which events to listen to and which module methods to call, then creates the scripts.

Creating one

  1. Open the Script Editor and click + in the Explorer, then Automation.
  2. Describe what should happen and when, in plain language.
  3. Click Generate. This can take a minute or two.

For example, this prompt:

When someone types "!hello" in Twitch chat, reply with a greeting.

produces a trigger on the Twitch chat.message event:

import { event } from "rawtoh"

export default event.payload.message === "!hello"

and the action it runs:

import { event, module } from "rawtoh"

await module("twitch").request("chat.say", {
  message: `Hello ${event.payload.username}!`,
})

One prompt can produce several actions, each with one or more triggers. The exact code depends on your prompt and on the modules available in your organization.

In the Explorer

An automation sits at the root of the Explorer and opens like a folder: inside are the folders, actions and triggers it generated.

Regenerating

Change the prompt on the automation's page and click Regenerate to rewrite the scripts from it. The current code is sent along with the prompt, so the AI edits what is there instead of starting over: scripts it keeps are updated in place, new ones are created, and ones the new prompt no longer needs are removed. You can also regenerate without touching the prompt.

Hand edits are part of what gets sent, but a regeneration may still rewrite them. If you have tuned a script by hand and want to keep it exactly as is, change it with the AI assist instead, or edit it yourself.

Deleting

Deleting an automation also deletes every action and trigger it generated. This cannot be undone.

AI assist in the editor

With an action or a trigger open, press Ctrl+I (or click the sparkle button next to the tabs) and say what should change in the script.

  1. Type your request and press Enter (Shift+Enter for a new line).
  2. Rawtoh shows the proposed code side by side with the current one.
  3. Not quite right? Type a follow-up in the bar above the diff and press Enter to refine it.
  4. Accept puts the new code in the editor; Reject leaves your script untouched.

Accepting only changes the editor content. Nothing is live until you save with Ctrl+S.

What the AI knows

Generation is grounded in your organization, not in guesses. Depending on the task, the AI can look up:

It still makes mistakes. Read what it wrote, and check the Activity panel the first time an automation runs.

Setting it up

AI features appear in the Script Editor once AI is available for your organization. Open Settings → AI and pick one of two modes:

Supported providers

ProviderNotes
AnthropicUsed when no provider is chosen
OpenAIAlso the one to pick for any OpenAI-compatible server
Google
Mistral

To use a self-hosted model (Ollama, LM Studio, vLLM…), select OpenAI and set the base URL to your server's endpoint, e.g. https://ai.example.com/v1. It has to be reachable from the Rawtoh server, not just from your machine.

Custom system prompt

In both modes you can add a custom system prompt: extra instructions appended to the platform's own when the AI assist generates code — naming conventions, a preferred style, things to avoid. Leave it empty to use the default only.

Who can use it

Creating, regenerating, renaming and deleting an automation requires permission to create, update and delete actions and triggers — by default, the organization owner.