AI Complete
AI Complete
Section titled “AI Complete”Type: ai-complete · Package: AI Activities v1.0.0 · Output: string
Sends a prompt to a large language model and returns its answer as text. Use it to summarise, draft, translate, classify, or answer questions about some content.
If what you need is specific fields (a serial number, a date, an amount), use AI Extract instead: it returns an object rather than text you would then have to parse.
How it works
Section titled “How it works”Sends system (the model’s role and rules) and prompt (the task at hand), plus the images if there are any, and returns the answer text.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
credential | credential | Zoan Cloud credential holding the provider’s API key. |
prompt | expression | The question or task for the model. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
provider | enum | AI provider. Defaults to Anthropic (Claude). |
model | expression | Model id. Leave empty to use the provider’s default model. |
system | expression | System instructions: the model’s role, rules and output style. |
images | list | Paths of images to send with the prompt (.jpg, .png, .gif, .webp). |
effort | enum | How much work the model puts in: low, medium, high, xhigh, max. |
thinking | boolean | Let the model reason before answering. |
maxTokens | expression | Maximum length of the answer, in tokens. Default 16000. |
timeout | expression | Seconds to wait. Default 600. |
Output
Section titled “Output”Returns a string with the model’s answer.
System and prompt
Section titled “System and prompt”The split matters: system describes who the model is and what rules it follows for the whole request; prompt is the task at hand. Putting the rules in the prompt works, but they get diluted when the content is long.
system → "You are a support email classifier. Answer with exactly one of these words: incident, question, spam."prompt → = emailBodyExample
Section titled “Example”Classify an incoming email and branch on it:
AI Complete credential = = credential("anthropic-key") system = "You are a support email classifier…" prompt = = email["body"] maxTokens = 10 → output: kindIf condition = = kind == "incident" ...Summarise a long contract:
PDF Get Text path = = contractPath → output: textAI Complete credential = = credential("anthropic-key") system = "Summarise as bullets, five at most, in English." prompt = = text → output: summaryCommon errors
Section titled “Common errors”| Message | What happened |
|---|---|
The model hit the 'maxTokens' limit before finishing | The answer does not fit. Raise maxTokens or ask for less text. |
The credential does not contain an Anthropic API key | The credential exists but is empty or holds something else. |
Claude declined this request for safety reasons | The model refused the content. This is an answer from the model, not a configuration failure. |
Related activities
Section titled “Related activities”- AI Extract — when you want fields instead of text.
- PDF Get Text — get a document’s text.