Skip to main content
ai.classify, Classify a document or text into one of a fixed label set using an LLM. Output exposes the picked label (constrained to the configured names), a coarse confidence, and a short justification. Pair with control.fail to reject documents that match an undesired label.

Configuration

Configuration goes inside the step’s with: block.
input
string
required
Template expression for the text to classify. Typically the output of ai.parse, e.g. ”{{ steps.parse.output.text }}”.
labels
array<object>
required
Allowed labels. The LLM is constrained to pick exactly one of these names.
prompt
string
Custom classification instructions appended to the system prompt. Use to clarify edge cases or emphasize evidence the model should weigh.
provider
string
Provider ID from eigenpal.config.yaml (e.g. “openai-gpt4o-mini”). Falls back to the tenant default LLM provider when omitted.
model
string
Model override (advanced)
maxInputTokens
integer
Max input tokens. Truncates input text when exceeded. Omit for no limit.

Output

The selected label name (one of the configured labels). Compare against literal strings to gate downstream steps.
LLM confidence in the classification. Coarse enum, numeric scores cluster meaninglessly at 0.85-0.95.
Short justification for the chosen label, useful for debugging.