Project Files
src / tools / detect_object.ts
import { tool, type Tool, type ToolsProviderController } from "@lmstudio/sdk";
import { z } from "zod";
import { formatToolMetaBlock } from "../core-bundle.mjs";
const DetectObjectParamsShape = {
targets: z
.union([
z.string().transform((s) => (s.match(/[aivp]\d+/gi) ?? []).map((x) => x.toLowerCase())),
z.array(z.string()),
])
.optional()
.describe("Reserved for future detect_object support. One or more image notations to process."),
task: z
.string()
.optional()
.default("")
.describe("Reserved for future detect_object support. What to detect."),
} satisfies Record<string, z.ZodTypeAny>;
export function createDetectObjectTool(_ctl: ToolsProviderController): Tool {
return tool({
name: "detect_object",
description: `Reserved future detection tool. It is intentionally not registered by user-docs in this release.
Use annotate_image for current bounding-box annotation workflows.
${formatToolMetaBlock()}`,
parameters: DetectObjectParamsShape,
implementation: async () => ({
content: [
{
type: "text",
text: "detect_object is reserved for a future API-only implementation and is not available in this release. Use annotate_image instead.",
},
],
isError: true as const,
}),
});
}