import { CallableFunctionModel } from "../schemas/callableFunction.schema.js"; import { ConversationCallableFunctionsModel } from "../schemas/conversationCallableFunctions.schema.js"; import { AddCallableFunctionListener, RemoveCallableFunctionListener } from "../utils/types/index.js"; import { CallableFunction } from "./CallableFunction.js"; import { ConversationPluginService } from "./ConversationPluginService.js"; /** * Holds the callable functions of a `Conversation`. * * @internal * This class is used internally by the library and is not meant to be **instantiated** by consumers of the library. */ export declare class ConversationCallableFunctions { private readonly pluginService; private functions; private addCallableFunctionEvents; private removeCallableFunctionEvents; constructor(pluginService: ConversationPluginService, options?: ConversationCallableFunctionsModel); /** * Serializes the `ConversationCallableFunctions` to JSON. * * @returns A JSON representation of the `ConversationCallableFunctions` instance. * * @internal * This method is used internally by the library and is not meant to be used by consumers of the library. */ toJSON(): ConversationCallableFunctionsModel; /** * Removes a callable function from the conversation. * * @param idOrFn Either the ID of the function, the function itself, or the function model. */ removeFunction(idOrFn: string | CallableFunction | CallableFunctionModel): void; /** * Removes all functions from the conversation. */ clearFunctions(): void; /** * Adds a function to the conversation. This function can be "called" by the assistant, generating a function call message. * * @param fn The function to add to the conversation. */ addFunction(fn: CallableFunction | CallableFunctionModel): void; /** * Get the functions in the conversation. * * @returns A **shallow copy** of the functions array. */ getFunctions(): CallableFunction[]; /** * Gets the functions in a format the OpenAI Chat Completion API can understand. */ getCreateChatCompletionFunctions(): import("../utils/types/callableFunction.types.js").CreateChatCompletionFunction[] | undefined; /** * Adds a listener function that is called whenever a callableFunction is added to the conversation. * * @param listener The function to call when a callableFunction is added to the conversation. * @returns A function that removes the listener from the list of listeners. */ onCallableFunctionAdded(listener: AddCallableFunctionListener): () => void; /** * Adds a listener function that is called only once whenever a callableFunction is added to the conversation. * * @param listener The function to call when a callableFunction is added to the conversation. * @returns A function that removes the listener from the list of listeners. */ onceCallableFunctionAdded(listener: AddCallableFunctionListener): () => void; /** * Removes a listener function from the list of listeners that was previously added with `onCallableFunctionAdded`. * * @param listener The function to remove from the list of listeners. */ offCallableFunctionAdded(listener: AddCallableFunctionListener): void; /** * Adds a listener function that is called whenever a callableFunction is removed to the conversation. * * @param listener The function to call when a callableFunction is removed to the conversation. * @returns A function that removes the listener from the list of listeners. */ onCallableFunctionRemoved(listener: RemoveCallableFunctionListener): () => void; /** * Adds a listener function that is called only once whenever a callableFunction is removed to the conversation. * * @param listener The function to call when a callableFunction is removed to the conversation. * @returns A function that removes the listener from the list of listeners. */ onceCallableFunctionRemoved(listener: RemoveCallableFunctionListener): () => void; /** * Removes a listener function from the list of listeners that was previously added with `onCallableFunctionRemoved`. * * @param listener The function to remove from the list of listeners. */ offCallableFunctionRemoved(listener: RemoveCallableFunctionListener): void; }