/** * Embedding model used as backbone for Classifier zero-shot requests. */ export type ClassifierEmbeddingModel = "jina-embeddings-v3" | "jina-embeddings-v4" | "jina-clip-v2"; /** Input element for the Classifier endpoint. Text-only is what the plugin uses. */ export interface ClassifierTextInput { text: string; } /** * Zero-shot classification request body for POST /v1/classify. * * `labels` must contain semantic category strings (the Classifier embeds * them and picks the closest one to each input). At least 2 labels. */ export interface JinaClassifyZeroShotRequest { model: ClassifierEmbeddingModel; input: ClassifierTextInput[]; labels: string[]; } /** * Few-shot classification request body for POST /v1/classify (with a * pre-trained classifier_id obtained out-of-band — the plugin does NOT * implement /v1/train; operators train via the Jina Playground or CLI and * paste the ID into the plugin config). */ export interface JinaClassifyFewShotRequest { classifier_id: string; input: ClassifierTextInput[]; } export type JinaClassifyRequest = JinaClassifyZeroShotRequest | JinaClassifyFewShotRequest; /** * Normalized classification outcome as seen by the rest of the plugin. * `label` is the picked class. `score` is the confidence in [0, 1] when * Jina returns it; `null` when the field is not in the response. */ export interface ClassificationOutcome { label: string; score: number | null; }