UNPKG

box-node-sdk

Version:

Official SDK for Box Plaform APIs

59 lines (58 loc) 2.76 kB
import BoxClient from '../box-client'; import * as schemas from '../schemas'; /** */ declare class AIManager { client: BoxClient; /** * @param {BoxClient} client The Box API Client that is responsible for making calls to the API */ constructor(client: BoxClient); /** * Send AI question request * * Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context. * @param {schemas.AiAsk} body * @param {object} [options] Options for the request * @param {Function} [callback] Passed the result if successful, error otherwise * @returns {Promise<schemas.AiResponseFull>} A promise resolving to the result or rejecting with an error */ ask(body: schemas.AiAsk, options?: {}, callback?: Function): Promise<schemas.AiResponseFull>; /** * Send AI request to generate text * * Sends an AI request to supported LLMs and returns an answer specifically focused on the creation of new text. * @param {schemas.AiTextGen} body * @param {object} [options] Options for the request * @param {Function} [callback] Passed the result if successful, error otherwise * @returns {Promise<schemas.AiResponse>} A promise resolving to the result or rejecting with an error */ textGen(body: schemas.AiTextGen, options?: {}, callback?: Function): Promise<schemas.AiResponse>; /** * Get AI agent default configuration * * Get the AI agent default config * @param {object} options Options for the request * @param {"ask" | "text_gen"} options.mode The mode to filter the agent config to return. * @param {string} [options.language] The ISO language code to return the agent config for. If the language is not supported the default agent config is returned. * @param {string} [options.model] The model to return the default agent config for. * @param {Function} [callback] Passed the result if successful, error otherwise * @returns {Promise<schemas.AiAgentAsk | schemas.AiAgentTextGen>} A promise resolving to the result or rejecting with an error */ getAiAgentDefaultConfig(options: { /** * The mode to filter the agent config to return. */ readonly mode: 'ask' | 'text_gen'; /** * The ISO language code to return the agent config for. * If the language is not supported the default agent config is returned. */ readonly language?: string; /** * The model to return the default agent config for. */ readonly model?: string; }, callback?: Function): Promise<schemas.AiAgentAsk | schemas.AiAgentTextGen>; } export = AIManager;