/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { imagesUpdate } from "../../funcs/imagesUpdate.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.UpdateImageRequest$inboundSchema, }; export const tool$imagesUpdate: ToolDefinition = { name: "images-update", description: `Replace an existing image and, optionally, its metadata. This endpoint replaces the existing image with the new PNG, JPEG, or WebP. Omit the metadata form section to keep existing metadata. Duplicate images, and requests larger than 16MB will be rejected.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await imagesUpdate( 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.result; return formatResult(value, apiCall); }, };