import { BaseChatOpenAI, BaseChatOpenAICallOptions, BaseChatOpenAIFields } from "./base.js";
import { OpenAI } from "openai";
import { BaseMessage, BaseMessageChunk } from "@langchain/core/messages";
import { ChatGenerationChunk, ChatResult } from "@langchain/core/outputs";
import { CallbackManagerForLLMRun } from "@langchain/core/callbacks/manager";
import { ChatModelStreamEvent } from "@langchain/core/language_models/event";

//#region src/chat_models/completions.d.ts
interface ChatOpenAICompletionsCallOptions extends BaseChatOpenAICallOptions {}
type ChatCompletionsInvocationParams = Omit<OpenAI.Chat.Completions.ChatCompletionCreateParams, "messages">;
/**
 * OpenAI Completions API implementation.
 * @internal
 */
declare class ChatOpenAICompletions<CallOptions extends ChatOpenAICompletionsCallOptions = ChatOpenAICompletionsCallOptions> extends BaseChatOpenAI<CallOptions> {
  constructor(model: string, fields?: Omit<BaseChatOpenAIFields, "model">);
  constructor(fields?: BaseChatOpenAIFields);
  /** @internal */
  invocationParams(options?: this["ParsedCallOptions"], extra?: {
    streaming?: boolean;
  }): ChatCompletionsInvocationParams;
  _generate(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;
  /**
   * Native implementation of the content-block-centric streaming protocol
   * for OpenAI Chat Completions.
   */
  _streamChatModelEvents(messages: BaseMessage[], options: this["ParsedCallOptions"], _runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatModelStreamEvent>;
  /** Provider id used in native stream protocol passthrough events. */
  protected get streamEventProvider(): string;
  _streamResponseChunks(messages: BaseMessage[], options: this["ParsedCallOptions"], runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;
  completionWithRetry(request: OpenAI.Chat.ChatCompletionCreateParamsStreaming, requestOptions?: OpenAI.RequestOptions): Promise<AsyncIterable<OpenAI.Chat.Completions.ChatCompletionChunk>>;
  completionWithRetry(request: OpenAI.Chat.ChatCompletionCreateParamsNonStreaming, requestOptions?: OpenAI.RequestOptions): Promise<OpenAI.Chat.Completions.ChatCompletion>;
  /**
   * @deprecated
   * This function was hoisted into a publicly accessible function from a
   * different export, but to maintain backwards compatibility with chat models
   * that depend on ChatOpenAICompletions, we'll keep it here as an overridable
   * method. This will be removed in a future release
   */
  protected _convertCompletionsDeltaToBaseMessageChunk(delta: Record<string, any>, rawResponse: OpenAI.Chat.Completions.ChatCompletionChunk, defaultRole?: OpenAI.Chat.ChatCompletionRole): BaseMessageChunk;
  /**
   * @deprecated
   * This function was hoisted into a publicly accessible function from a
   * different export, but to maintain backwards compatibility with chat models
   * that depend on ChatOpenAICompletions, we'll keep it here as an overridable
   * method. This will be removed in a future release
   */
  protected _convertCompletionsMessageToBaseMessage(message: OpenAI.ChatCompletionMessage, rawResponse: OpenAI.ChatCompletion): BaseMessage;
}
//#endregion
export { ChatOpenAICompletions, ChatOpenAICompletionsCallOptions };
//# sourceMappingURL=completions.d.ts.map