/** * Options for getting a result from the OpenAI API * @template T The type of the function */ export type ResOptions = { /** * Rough type of the function * @example (number, number) => number */ func: string; /** * The arguments for the function * @example ["4", "5"] */ args: Array; /** * A description of the function being called */ desc: string; /** * The name of the OpenAI API model to use * @default 'gpt-3.5-turbo' */ model?: string; /** * A function to post-process the API response */ postProcess?: (response: unknown) => T; }; /** * Options for creating a function using the OpenAI API * @template T The type of the function */ export type CreateFucntionOptions = { /** * Rough type of the function */ func: string; /** * Description of the function being defined */ desc: string; /** * The name of the OpenAI API model to use * @default 'gpt-3.5-turbo' */ model?: string; /** * A function to evaluate the function definition * @default Function (Function constructor) */ evaluate?: (...args: string[]) => T; }; export declare class GPTFunctions { private openai; constructor(apiKey: string); /** * Generate the result of calling a function * @param {ResOptions} options - The options for generating the result. * @returns {Promise} - A promise that resolves to the result of calling the function. * @template T */ getResult: ({ func, args, desc, model, postProcess }: ResOptions) => Promise; /** * Generate a function using inly it's description * @param {CreateFucntionOptions} options - The options for generating the function. * @returns {Promise} - A promise that resolves to the generated function. */ createFunction: unknown>(options: string | CreateFucntionOptions) => Promise; }