/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { entitiesCreateInstruction } from "../../funcs/entitiesCreateInstruction.js"; import * as components from "../../models/components/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: components.CreateInstructionParams$inboundSchema, }; export const tool$entitiesCreateInstruction: ToolDefinition = { name: "entities-create-instruction", description: `Create Instruction Create a new instruction. Instructions are applied to documents as they are created or updated. The results of the instruction are stored as structured data in the schema defined by the \`entity_schema\` parameter. The \`prompt\` parameter is a natural language instruction which will be applied to documents. This feature is in beta and may change in the future.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await entitiesCreateInstruction( 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); }, };