/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { documentsRetrieveSimilar } from "../../funcs/documentsRetrieveSimilar.js"; import * as components from "../../models/components/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: components.RetrieveSimilarDocumentsRequest$inboundSchema, }; export const tool$documentsRetrieveSimilar: ToolDefinition = { name: "documents-retrieve-similar", description: `Find documents similar to a given document Retrieve documents that are similar to a specified document based on content similarity`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await documentsRetrieveSimilar( 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); }, };