/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { searchVisualSearchAssets } from "../../funcs/searchVisualSearchAssets.js";
import * as components from "../../models/components/index.js";
import { formatResult } from "../tools.js";
const args = {
    request: components.VisualSearchParametersUnion$inboundSchema,
};
export const tool$searchVisualSearchAssets = {
    name: "visual-search-assets",
    description: `Finds images in your asset library based on visual similarity or content

Returns a list of resources that are visually similar to a specified image. You can provide the source image for comparison in one of three ways:
- Provide a URL of an image
- Specify the public ID or asset ID of an existing image
- Provide a textual description
`,
    scopes: ["librarian"],
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await searchVisualSearchAssets(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return formatResult(value, apiCall);
    },
};
//# sourceMappingURL=searchVisualSearchAssets.js.map