Defining Intents
Create custom intents with prompt templates and optional structured output schemas.
Create an intent
Prompt templates
Prompt templates use {{variable}} placeholders that are replaced at request time from the input object sent by your application.
Template:
Request input:
Any key in input can be used as a placeholder. Unknown placeholders are left as-is and visible in the output for debugging.
Calling a custom intent
Once created, the intent is immediately callable:
Structured output schema (optional)
To enforce a JSON output structure, provide a JSON Schema in outputSchema:
When a schema is provided, the engine validates the AI output against it and returns it in data.output.structuredOutput.
Intent key rules
- Lowercase letters, numbers, and underscores:
^[a-z0-9_]+$ - Must be unique within the domain
- Used as the URL path segment:
/v1/{domainKey}/{intentKey}
Updating an intent
Updates take effect immediately on the next API call.