Get Started

Prompts

Reusable, parameterized prompt templates. Define a template with {{variable}} placeholders once, then render it with values whenever you need the text.

Reach for a Prompt when you want to produce text from a template. If the text should always be in the agent's context, use an Instruction instead.

Create a prompt

import { Theazo } from 'theazo'

const theazo = new Theazo({ apiKey: process.env.THEAZO_API_KEY })

const prompt = await theazo.prompts.create({
  name: 'support-triage',
  template: 'Triage this ticket for {{customer}}:\n\n{{body}}',
  variables: [
    { name: 'customer', required: true },
    { name: 'body', required: true },
  ],
})
FieldTypeRequiredDescription
namestringyesHuman label, unique within (platform, kind).
descriptionstringLabel; for skills this is the runtime gate (required there).
enabledbooleanDefault true.
templatestringyesTemplate with {{variable}} placeholders.
variablesobject[]Declared template variables.

Render it

Rendering substitutes the values into the placeholders and returns the finished string. A missing required variable (with no default) is rejected with invalid_request.

const text = await theazo.prompts.render(prompt.id, {
  customer: 'Acme Corp',
  body: 'My export keeps timing out.',
})
// → "Triage this ticket for Acme Corp:\n\nMy export keeps timing out."

SDK methods

theazo.prompts.create(opts)PromptCreate a prompt template.
theazo.prompts.render(id, vars)stringRender with values; missing required vars throw.
theazo.prompts.list()Prompt[]List all prompts on the platform.
theazo.prompts.get(id)PromptFetch one by id.
theazo.prompts.update(id, opts)PromptUpdate template or variables.
theazo.prompts.delete(id)voidDelete. Blocked (409) if still attached.

See also: Instructions, Skills, Hooks.

Was this page helpful?