document classifier agent that runs as a policy and assigns a category and sub-category docType

This commit is contained in:
EthanHealy01
2026-06-29 21:58:03 +01:00
parent 501a7199e0
commit fed7ad300f
37 changed files with 2309 additions and 100 deletions
@@ -0,0 +1,27 @@
import { ToolType } from "@app/hooks/tools/shared/useToolOperation";
/** Classify-and-tag takes no user parameters — it only needs the file. */
export type ClassifyParameters = Record<string, never>;
export const defaultParameters: ClassifyParameters = {};
// Static function shared by the registry/automation executor. The backend reads
// only the file: it classifies via the AI engine and writes the result into the
// StirlingPDFClassification metadata field.
export const buildClassifyFormData = (
_parameters: ClassifyParameters,
file: File,
): FormData => {
const formData = new FormData();
formData.append("fileInput", file);
return formData;
};
export const classifyOperationConfig = {
toolType: ToolType.singleFile,
buildFormData: buildClassifyFormData,
operationType: "classify",
endpoint: "/api/v1/ai/tools/classify-and-tag",
multiFileEndpoint: false,
defaultParameters,
} as const;