इसे छोड़कर कंटेंट पर जाएं
GitHub

AI steps

यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।

Two steps ask a language model: AI: ask a model (ai.chat) for one answer, and AI: run an agent (ai.agent) for a model that works toward a goal using your other workflows as its tools.

The model is yours. A credential of type AI model says where it runs and which one to use, and nothing in Cascade sends a prompt anywhere else. There is no hosted service, no account with us and nothing to turn on: run a model on a box you own, or use a hosted service with your own key. Every call goes through the egress policy like any other outbound call, so a model on your plant network has to be allowed (HOTLOOP_CASCADE_EGRESS_ALLOW, by host name or CIDR).

Field Details
Protocol openai (the default) speaks the OpenAI chat completions protocol, which is also what Ollama, vLLM, llama.cpp and LM Studio serve. anthropic speaks Anthropic’s messages protocol.
Server URL Empty uses the provider’s own (https://api.openai.com/v1, https://api.anthropic.com). For a local model, its address with the version path, like http://ollama.plant.lan:11434/v1.
API key A secret, sealed in the vault. Empty for a local model.
Model name The model to ask, like qwen2.5:1.5b or gpt-4.1. A step can override it.
- name: Summarize
type: ai.chat
version: 1
params:
system: You write one plain sentence for a shift handover.
prompt: "Alarm on {{ item.json.line }}: {{ item.json.message }}"
temperature: 0
credentials:
model: my-model

The answer goes under ai on the item (change it with into): ai.text, ai.model, ai.finishReason and ai.usage.inputTokens and outputTokens. With output: json the model is asked for a JSON object, a schema makes servers that enforce one hold it to that shape, and the parsed object is in ai.json. A reply that isn’t JSON stops the step with what the model wrote.

- name: Find out
type: ai.agent
version: 1
params:
prompt: "What is oven {{ item.json.oven }} at? Use the tool, then answer in degrees C."
tools:
- name: read_oven
description: Reads the current temperature of an oven, in degrees C.
workflow: 0197b2a4-....
parameters:
type: object
properties: {oven: {type: integer}}
required: [oven]
maxTurns: 6
credentials:
model: my-model

Each tool is a workflow in the same project that starts with When another workflow runs this one. When the model asks for a tool, Cascade runs that workflow with the arguments the model gave as one item, waits for it, and hands its last output back to the model as the tool’s result. A failed tool goes back as an error the model can read and react to. A name the step never offered goes back the same way. This repeats until the model answers without asking for another tool, or maxTurns (1 to 50, default 10) is reached and the step stops.

Between turns the run waits in the database, not in a worker, so a tool that takes an hour costs nothing and a restart loses only the turn in flight. Each item is its own conversation, and the result is on the item under ai: text, turns, toolCalls (the names, in order), model and usage.

Because a tool is a workflow, it has the permissions of its own project and its own credentials, and shows up in the executions list like any other run. Give an agent only the tools you would give a person on that shift.