/** * LLM-backed intent classifier — first step of the default pipeline. * * The framework stays SDK-agnostic. Bots wire in any structured-output LLM * call via the `classify` callback (Vercel AI SDK's `generateObject`, OpenAI * tool-calling, Anthropic structured output, a regex fallback, etc.). * * Example: * const intents = ['question', 'booking', 'cancel', 'other'] as const; * const classifier = new LLMIntentClassifier({ * intents, * classify: async (text) => { * const { object } = await generateObject({ * model: openai('gpt-4o-mini'), * schema: z.object({ intent: z.enum(intents), confidence: z.number() }), * prompt: text, * }); * return object; * }, * fallback: 'other', * }); */ import type { PipelineContext, PipelineStep, StepResult } from './types.js'; export interface IntentResult { intent: I; confidence?: number; } export type IntentClassifyFn = (text: string, opts: { intents: readonly I[]; signal?: AbortSignal; }) => Promise>; export interface LLMIntentClassifierOptions { intents: readonly I[]; classify: IntentClassifyFn; fallback: I; stepName?: string; } export declare class LLMIntentClassifier implements PipelineStep { readonly name: string; readonly intents: readonly I[]; readonly classify: IntentClassifyFn; readonly fallback: I; constructor({ intents, classify, fallback, stepName }: LLMIntentClassifierOptions); run(ctx: PipelineContext, _decision: unknown): Promise; } //# sourceMappingURL=intent.d.ts.map