import { z, ModelReference, EmbedderReference } from 'genkit';
import { GenkitPlugin } from 'genkit/plugin';
import { SpeechConfigSchema, TranscriptionConfigSchema } from '../audio.js';
import { ImageGenerationCommonConfigSchema } from '../image.js';
import { PluginOptions } from '../index.js';
import { SUPPORTED_IMAGE_MODELS } from './dalle.js';
import { SUPPORTED_EMBEDDING_MODELS, TextEmbeddingConfigSchema } from './embedder.js';
import { SUPPORTED_GPT_MODELS, OpenAIChatCompletionConfigSchema } from './gpt.js';
import { SUPPORTED_TTS_MODELS } from './tts.js';
import { SUPPORTED_STT_MODELS } from './whisper.js';
import 'genkit/model';
import 'openai';
import 'openai/resources/audio/index.mjs';
import 'openai/resources/images.mjs';
import 'genkit/registry';
import '../embedder.js';
import '../model.js';
import 'openai/resources/index.mjs';

/**
 * Copyright 2024 The Fire Company
 * Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

type OpenAIPluginOptions = Omit<PluginOptions, 'name' | 'baseURL'>;
declare function openAIPlugin(options?: OpenAIPluginOptions): GenkitPlugin;
type OpenAIPlugin = {
    (params?: OpenAIPluginOptions): GenkitPlugin;
    model(name: keyof typeof SUPPORTED_GPT_MODELS | (`gpt-${string}` & {}) | (`o${number}` & {}), config?: z.infer<typeof OpenAIChatCompletionConfigSchema>): ModelReference<typeof OpenAIChatCompletionConfigSchema>;
    model(name: keyof typeof SUPPORTED_IMAGE_MODELS | (`dall-e${string}` & {}) | (`gpt-image-${string}` & {}), config?: z.infer<typeof ImageGenerationCommonConfigSchema>): ModelReference<typeof ImageGenerationCommonConfigSchema>;
    model(name: keyof typeof SUPPORTED_TTS_MODELS | (`tts-${string}` & {}) | (`${string}-tts` & {}), config?: z.infer<typeof SpeechConfigSchema>): ModelReference<typeof SpeechConfigSchema>;
    model(name: keyof typeof SUPPORTED_STT_MODELS | (`whisper-${string}` & {}) | (`${string}-transcribe` & {}), config?: z.infer<typeof TranscriptionConfigSchema>): ModelReference<typeof TranscriptionConfigSchema>;
    model(name: string, config?: any): ModelReference<z.ZodTypeAny>;
    embedder(name: keyof typeof SUPPORTED_EMBEDDING_MODELS | (`${string}-embedding-${string}` & {}), config?: z.infer<typeof TextEmbeddingConfigSchema>): EmbedderReference<typeof TextEmbeddingConfigSchema>;
    embedder(name: string, config?: any): EmbedderReference<z.ZodTypeAny>;
};
/**
 * This module provides an interface to the OpenAI models through the Genkit
 * plugin system. It allows users to interact with various models by providing
 * an API key and optional configuration.
 *
 * The main export is the `openai` plugin, which can be configured with an API
 * key either directly or through environment variables. It initializes the
 * OpenAI client and makes available the models for use.
 *
 * Exports:
 * - openai: The main plugin function to interact with OpenAI.
 *
 * Usage:
 * To use the models, initialize the openai plugin inside `configureGenkit` and
 * pass the configuration options. If no API key is provided in the options, the
 * environment variable `OPENAI_API_KEY` must be set.
 *
 * Example:
 * ```
 * import { openAI } from '@genkit-ai/compat-oai/openai';
 *
 * export default configureGenkit({
 *  plugins: [
 *    openai()
 *    ... // other plugins
 *  ]
 * });
 * ```
 */
declare const openAI: OpenAIPlugin;

export { type OpenAIPlugin, type OpenAIPluginOptions, openAI as default, openAI, openAIPlugin };
