/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { IRunConfig, TaskConfig } from "@workglow/task-graph"; import { CreateWorkflow } from "@workglow/task-graph"; import { DataPortSchema } from "@workglow/util/schema"; import type { ModelConfig } from "../model/ModelSchema"; import { AiTask } from "./base/AiTask"; export declare const TextClassificationInputSchema: { readonly type: "object"; readonly properties: { readonly text: { readonly type: "string"; readonly title: "Text"; readonly description: "The text to classify"; }; readonly candidateLabels: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly title: "Candidate Labels"; readonly description: "List of candidate labels (optional, if provided uses zero-shot classification)"; readonly "x-ui-group": "Configuration"; }; readonly maxCategories: { readonly type: "number"; readonly minimum: 1; readonly maximum: 1000; readonly default: 5; readonly title: "Max Categories"; readonly description: "The maximum number of categories to return"; readonly "x-ui-group": "Configuration"; }; readonly model: { readonly oneOf: readonly [{ readonly title: "Model"; readonly description: `The model ${string}`; } & Record & { readonly format: import(".").TypeModelSemantic; readonly type: "string"; }, { readonly type: "object"; readonly properties: { readonly model_id: { readonly type: "string"; }; readonly capabilities: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly "x-ui-editor": "multiselect"; }; readonly title: { readonly type: "string"; }; readonly description: { readonly type: "string"; readonly "x-ui-editor": "textarea"; }; readonly provider: { readonly type: "string"; }; readonly provider_config: { readonly type: "object"; readonly properties: { readonly credential_key: { readonly type: "string"; readonly format: "credential"; readonly "x-ui-hidden": true; }; readonly native_dimensions: { readonly type: "integer"; readonly description: "Native output vector dimensions for embedding models"; }; readonly mrl: { readonly type: "boolean"; readonly description: "Whether the model supports Matryoshka Representation Learning"; }; }; readonly additionalProperties: true; readonly default: {}; }; readonly metadata: { readonly type: "object"; readonly default: {}; readonly "x-ui-hidden": true; }; }; readonly required: readonly ["provider", "provider_config"]; readonly format: "model"; readonly additionalProperties: true; } & Record & { readonly format: import(".").TypeModelSemantic; }]; } & Record & { readonly format: import(".").TypeModelSemantic; }; }; readonly required: readonly ["text", "model"]; readonly additionalProperties: false; }; export declare const TextClassificationOutputSchema: { readonly type: "object"; readonly properties: { readonly categories: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly label: { readonly type: "string"; readonly title: "Label"; readonly description: "The name of the category"; }; readonly score: { readonly type: "number"; readonly title: "Score"; readonly description: "The confidence score for this category"; }; }; readonly required: readonly ["label", "score"]; readonly additionalProperties: false; }; readonly title: "Categories"; readonly description: "The classification categories with their scores"; }; }; readonly required: readonly ["categories"]; readonly additionalProperties: false; }; export type TextClassificationTaskInput = { maxCategories?: number | undefined; candidateLabels?: string[] | undefined; model: string | ModelConfig; text: string; }; export type TextClassificationTaskOutput = { categories: { score: number; label: string; }[]; }; export type TextClassificationTaskConfig = TaskConfig; /** * Classifies text into categories using language models. * Automatically selects between regular and zero-shot classification based on whether candidate labels are provided. */ export declare class TextClassificationTask extends AiTask { static type: string; /** Capabilities required of the model; gated in {@link AiTask.execute}. */ static readonly requires: ["text.classification"]; static category: string; static title: string; static description: string; static inputSchema(): DataPortSchema; static outputSchema(): DataPortSchema; } export declare const textClassification: (input: TextClassificationTaskInput, config?: TextClassificationTaskConfig, runConfig?: Partial) => Promise; declare module "@workglow/task-graph" { interface Workflow { textClassification: CreateWorkflow; } } //# sourceMappingURL=TextClassificationTask.d.ts.map