Skip to content

ClassificationResponse

Response from the text classification endpoint containing the classification result, confidence, and metadata.

Example Usage

typescript
import { ClassificationResponse } from "@meetkai/mka1/models/components";

let value: ClassificationResponse = {
  success: true,
  data: {
    label: "positive",
    confidence: 0.92,
    reasoning:
      "The text expresses strong enthusiasm with phrases like 'absolutely love' and 'best purchase ever'.",
  },
  metadata: {
    model: "openai:gpt-4o-mini",
    labels: [
      "positive",
      "negative",
      "neutral",
    ],
    classifiedAt: "2024-01-15T10:30:00Z",
  },
};

Fields

FieldTypeRequiredDescription
successboolean✔️Indicates whether the classification request was successful
datacomponents.ClassificationResponseData✔️The classification result data
metadatacomponents.Metadata✔️Metadata about the classification request and execution