/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { documentsIndexFile } from "../../funcs/documentsIndexFile.js"; import * as components from "../../models/components/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: components.IndexFileRequest$inboundSchema, }; export const tool$documentsIndexFile: ToolDefinition = { name: "documents-index-file", description: `Index a document by uploading a file Index a document into the specified index by uploading a file. Supports UTF-8 encoded text-based files and PDF files. The file size must be less than 60MB. `, args, tool: async (client, args, ctx) => { const [result, apiCall] = await documentsIndexFile( 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); }, };