import { Message } from "./Message.js"; import { ConversationConfig } from "./ConversationConfig.js"; import { ConversationRequestOptions } from "./ConversationRequestOptions.js"; import { ConversationHistory } from "./ConversationHistory.js"; import { ConversationCallableFunctions } from "./ConversationCallableFunctions.js"; import { ConversationRequestOptionsModel } from "../schemas/conversationRequestOptions.schema.js"; import { HandleChatCompletionOptions, PromptOptions } from "../utils/types/index.js"; import { ConversationPluginService } from "./ConversationPluginService.js"; /** * Encapsulates the logic for sending requests to the OpenAI API for the Create Chat Completion endpoint. * * @internal * This class is used internally by the library and is not meant to be **instantiated** by consumers of the library. */ export declare class ChatCompletionService { private readonly pluginService; private readonly config; private readonly requestOptions; private readonly history; private readonly callableFunctions; constructor(pluginService: ConversationPluginService, config: ConversationConfig, requestOptions: ConversationRequestOptions, history: ConversationHistory, callableFunctions: ConversationCallableFunctions); /** * @internal * Should not be used directly by library consumers. Use `getChatCompletionResponse` from the `Conversation` class instead. */ getChatCompletionResponse(options?: PromptOptions, requestOptions?: ConversationRequestOptionsModel): Promise; /** * Gets the assistant's response given the current messages stored in the conversation's history, moderates it if moderation is enabled, and adds it to the conversation's history. * * @param options Additional options to pass to the Create Chat Completion API endpoint. This overrides the config passed to the constructor. * @param requestOptions Additional options to pass for the HTTP request. This overrides the config passed to the constructor. * @returns The assistant's response as a [`Message`](./Message.js) instance. */ getAssistantResponse(options?: PromptOptions, requestOptions?: ConversationRequestOptionsModel): Promise; /** * @internal * Should not be used directly by library consumers. Use `moderate` from the `Message` class instead. */ moderateMessage(message: Message, requestOptions?: ConversationRequestOptionsModel): Promise; handleStreamedResponse(options?: HandleChatCompletionOptions, requestOptions?: ConversationRequestOptionsModel): Message; handleNonStreamedResponse(options?: HandleChatCompletionOptions, requestOptions?: ConversationRequestOptionsModel): Promise; }