/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { analyzeCldText } from "../../funcs/analyzeCldText.js";
import * as components from "../../models/components/index.js";
import { formatResult } from "../tools.js";
const args = {
    request: components.BaseAnalyzeRequest$inboundSchema,
};
export const tool$analyzeCldText = {
    name: "analyze-cld-text",
    description: `Analyze - Cld-Text

Analyze an image using the [Cld-Text](https://cloudinary.com/documentation/cloudinary_ai_content_analysis_addon#ai_based_image_captioning) content-aware detection model. Cloudinary's text model tells you if your image includes text, and where it's located. Used with image tagging, you can then search for images that contain blocks of text. Used with object-aware cropping, you can choose to keep only the text part, or specify a crop that avoids the text.`,
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await analyzeCldText(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=analyzeCldText.js.map