import { ConversationModel } from "../schemas/conversation.schema.js"; import { ConversationCallableFunctionsModel } from "../schemas/conversationCallableFunctions.schema.js"; import { ConversationConfigModel } from "../schemas/conversationConfig.schema.js"; import { ConversationHistoryModel } from "../schemas/conversationHistory.schema.js"; import { ConversationRequestOptionsModel } from "../schemas/conversationRequestOptions.schema.js"; import { ConversationPluginDefinition, ConversationPlugin, ConversationPluginProperties } from "../utils/types/index.js"; import { Message } from "./Message.js"; /** * Manages the plugins of a conversation and acts as a bridge between the plugins and the conversation. * * @remarks * Most of these methods are not documented (with TypeDocs). * In most cases, this is because they just call the equivalent method on each plugin. * Refer to the documentation of the `ConversationPluginCreatorDefinitionBase` interface for their documentation. * * @internal * This class is used internally by the library and is not meant to be **instantiated** by consumers of the library. */ export declare class ConversationPluginService { private readonly pluginCreators; private plugins; constructor(pluginCreators: TPluginCreators); getPlugins(): ConversationPluginDefinition[]; onInit(properties: ConversationPluginProperties, pluginsData?: ConversationModel["pluginsData"]): void; onPostInit(): void; transformConversationJson(json: ConversationModel): { id?: string | undefined; history?: { messages?: { role: "function" | "user" | "assistant" | "system"; content: string | null; id?: string | undefined; name?: string | undefined; function_call?: { name: string; arguments: Record; } | undefined; model?: string | undefined; flags?: string[] | null | undefined; }[] | undefined; } | undefined; config?: { context?: string | undefined; dry?: boolean | undefined; disableModeration?: boolean | "soft" | undefined; apiKey?: string | undefined; model?: string | undefined; temperature?: number | undefined; top_p?: number | undefined; stream?: boolean | undefined; stop?: string | string[] | null | undefined; max_tokens?: number | undefined; presence_penalty?: number | undefined; frequency_penalty?: number | undefined; logit_bias?: Record | undefined; user?: string | undefined; function_call?: "none" | "auto" | { name: string; } | undefined; } | undefined; callableFunctions?: { functions?: { name: string; id?: string | undefined; description?: string | undefined; parameters?: { type: "object"; title?: string | undefined; description?: string | undefined; default?: any; examples?: any[] | undefined; readOnly?: boolean | undefined; writeOnly?: boolean | undefined; deprecated?: boolean | undefined; $comment?: string | undefined; required?: string[] | undefined; unevaluatedProperties?: boolean | undefined; minProperties?: number | undefined; maxProperties?: number | undefined; properties?: Record | undefined; patternProperties?: Record | undefined; additionalProperties?: boolean | import("../index.js").JsonSchema | undefined; } | undefined; }[] | undefined; } | undefined; requestOptions?: { headers?: Record | undefined; proxy?: { host: string; port?: number | undefined; protocol?: "http" | "https" | undefined; auth?: { username: string; password: string; } | undefined; } | undefined; } | undefined; pluginsData?: Record | undefined; }; transformConversationCallableFunctionsJson(json: ConversationCallableFunctionsModel): { functions?: { name: string; id?: string | undefined; description?: string | undefined; parameters?: { type: "object"; title?: string | undefined; description?: string | undefined; default?: any; examples?: any[] | undefined; readOnly?: boolean | undefined; writeOnly?: boolean | undefined; deprecated?: boolean | undefined; $comment?: string | undefined; required?: string[] | undefined; unevaluatedProperties?: boolean | undefined; minProperties?: number | undefined; maxProperties?: number | undefined; properties?: Record | undefined; patternProperties?: Record | undefined; additionalProperties?: boolean | import("../index.js").JsonSchema | undefined; } | undefined; }[] | undefined; }; transformConversationConfigJson(json: ConversationConfigModel): { context?: string | undefined; dry?: boolean | undefined; disableModeration?: boolean | "soft" | undefined; apiKey?: string | undefined; model?: string | undefined; temperature?: number | undefined; top_p?: number | undefined; stream?: boolean | undefined; stop?: string | string[] | null | undefined; max_tokens?: number | undefined; presence_penalty?: number | undefined; frequency_penalty?: number | undefined; logit_bias?: Record | undefined; user?: string | undefined; function_call?: "none" | "auto" | { name: string; } | undefined; }; transformConversationHistoryJson(json: ConversationHistoryModel): { messages?: { role: "function" | "user" | "assistant" | "system"; content: string | null; id?: string | undefined; name?: string | undefined; function_call?: { name: string; arguments: Record; } | undefined; model?: string | undefined; flags?: string[] | null | undefined; }[] | undefined; }; transformConversationRequestOptionsJson(json: ConversationRequestOptionsModel): { headers?: Record | undefined; proxy?: { host: string; port?: number | undefined; protocol?: "http" | "https" | undefined; auth?: { username: string; password: string; } | undefined; } | undefined; }; onUserPrompt(message: Message): Promise; onUserPromptError(error: unknown): Promise; onChatCompletion(message: Message): Promise; transformFunctionResult(result: any): Promise; onFunctionPrompt(message: Message): Promise; onFunctionPromptError(error: unknown): Promise; getPluginsData(): Record; onModeration(message: Message): Promise; }