Classifier output types

Classifier outputs follow standardized formats. Understanding this format is essential when working with evaluation sets, webhooks, and API responses.

Classify Output Type

Type Definition

1type ClassifyOutput = {
2 id: string;
3 type: string;
4 confidence: number;
5 insights?: Insight[];
6};

Example

1{
2 "id": "invoice",
3 "type": "invoice",
4 "confidence": 0.95,
5 "insights": [
6 {
7 "type": "reasoning",
8 "content": "Document contains itemized charges and payment terms"
9 }
10 ]
11}

Shared Types

Certain types are shared across different run outputs. These provide additional context and information about the classifier’s decisions.

Type Definition

1type Insight = {
2 type: "reasoning"; // Currently only reasoning is supported
3 content: string; // The explanation or reasoning provided by the model
4};

Example

1{
2 "insights": [
3 {
4 "type": "reasoning",
5 "content": "This was classified as an invoice because it contains standard invoice elements including an invoice number, billing details, and itemized charges."
6 }
7 ]
8}

Insights can appear in both extraction and classification outputs to provide transparency into the model’s decision-making process. They are particularly useful when debugging or validating run results.