/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { documentsGetSummary } from "../../funcs/documentsGetSummary.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.GetDocumentSummaryRequest$inboundSchema, }; export const tool$documentsGetSummary: ToolDefinition = { name: "documents-get-summary", description: `Get Document Summary Get a LLM generated summary of the document. The summary is created when the document is first created or updated. Documents of types ['xls', 'xlsx', 'csv', 'json'] are not supported for summarization. Documents greater than 1M in token length are not supported. This feature is in beta and may change in the future.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await documentsGetSummary( 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); }, };