import { CommonRequestOptions } from '@xsai/shared'; interface ChatProvider { chat: (model: (string & {}) | T) => CommonRequestOptions; } interface EmbedProvider { embed: (model: (string & {}) | T) => CommonRequestOptions; } interface ModelProvider { model: () => ProviderResult; } /** T: required apiKey */ type ProviderOptions = T extends true ? Partial> & Required> : Partial; type ProviderResult = Omit & Partial>; interface SpeechProvider { speech: T2 extends undefined ? (model: (string & {}) | T) => CommonRequestOptions : (model: (string & {}) | T, extraOptions?: T2) => CommonRequestOptions & T2; } interface TranscriptionProvider { transcription: (model: (string & {}) | T) => CommonRequestOptions; } declare const createGoogleGenerativeAI: (userOptions: ProviderOptions) => /** @see {@link https://aistudio.google.com/u/1/prompts/new_chat} */ ChatProvider<"gemini-1.5-flash" | "gemini-1.5-flash-8b" | "gemini-1.5-pro" | "gemini-2.0-flash-exp" | "gemini-2.0-flash-thinking-exp-1219" | "gemini-exp-1206" | "gemma-2-2b-it" | "gemma-2-9b-it" | "gemma-2-27b-it" | "lernlm-1.5-pro-experimental"> & EmbedProvider<"text-embedding-004"> & ModelProvider; declare const createOllama: (userOptions?: ProviderOptions) => /** @see {@link https://ollama.com/search} */ ChatProvider<"gemma2" | "llama3.1" | "llama3.2" | "llama3.2-vision" | "llama3.3" | "qwen2.5" | "qwen2.5-coder" | "qwq"> & EmbedProvider<"all-minilm" | "mxbai-embed-large" | "nomic-embed-text"> & ModelProvider; declare const ollama: ChatProvider<"gemma2" | "llama3.1" | "llama3.2" | "llama3.2-vision" | "llama3.3" | "qwen2.5" | "qwen2.5-coder" | "qwq"> & EmbedProvider<"all-minilm" | "mxbai-embed-large" | "nomic-embed-text"> & ModelProvider; declare const createOpenAI: (userOptions: ProviderOptions) => /** @see {@link https://platform.openai.com/docs/models#model-endpoint-compatibility} */ ChatProvider<"gpt-4o" | "gpt-4o-mini" | "o1-mini" | "o1-preview"> & EmbedProvider<"text-embedding-3-large" | "text-embedding-3-small"> & ModelProvider & SpeechProvider<"tts-1" | "tts-1-hd"> & TranscriptionProvider<"whisper-1">; /** @see {@link https://elevenlabs.io/docs/api-reference/text-to-speech/convert#request} */ interface UnElevenLabsOptions { /** * This parameter controls text normalization with three modes: 'auto', 'on', and 'off'. When set to 'auto', * the system will automatically decide whether to apply text normalization (e.g., spelling out numbers). * With 'on', text normalization will always be applied, while with 'off', it will be skipped. Cannot be * turned on for 'eleven_turbo_v2_5' model. */ applyTextNormalization?: 'auto' | 'off' | 'on'; /** * Language code (ISO 639-1) used to enforce a language for the model. Currently only Turbo v2.5 * supports language enforcement. For other models, an error will be returned if language code is provided. */ languageCode?: string; /** * A list of request_id of the samples that were generated before this generation. Can * be used to improve the flow of prosody when splitting up a large task into multiple * requests. The results will be best when the same model is used across the generations. * * In case both next_text and next_request_ids is send, next_text will be ignored. * A maximum of 3 request_ids can be send. */ nextRequestIds?: string[]; /** * The text that comes after the text of the current request. Can be used to improve * the flow of prosody when concatenating together multiple generations or to influence * the prosody in the current generation. */ nextText?: string; /** * A list of request_id of the samples that were generated before this generation. Can be * used to improve the flow of prosody when splitting up a large task into multiple requests. * The results will be best when the same model is used across the generations. In case both * previous_text and previous_request_ids is send, previous_text will be ignored. A maximum * of 3 request_ids can be send. */ previousRequestIds?: string[]; /** * The text that came before the text of the current request. Can be used to improve the * flow of prosody when concatenating together multiple generations or to influence the * prosody in the current generation. */ previousText?: string; /** * A list of pronunciation dictionary locators (id, version_id) to be applied to the text. * They will be applied in order. You may have up to 3 locators per request */ pronunciationDictionaryLocators?: { pronunciationDictionaryId: string; versionId: string; }[]; /** * If specified, our system will make a best effort to sample deterministically, such that * repeated requests with the same seed and parameters should return the same result. * Determinism is not guaranteed. Must be integer between 0 and 4294967295. */ seed?: number; /** * Voice settings overriding stored settings for the given voice. They are applied only on the given request. */ voiceSettings?: { similarityBoost?: number; stability?: number; style?: number; useSpeakerBoost?: boolean; }; } /** * [ElevenLabs](https://elevenlabs.io/) provider for [UnSpeech](https://github.com/moeru-ai/unspeech) * only. * * [UnSpeech](https://github.com/moeru-ai/unspeech) is a open-source project that provides a * OpenAI-compatible audio & speech related API that can be used with various providers such * as ElevenLabs, Azure TTS, Google TTS, etc. * * @param userOptions - The provider options * @returns SpeechProvider */ declare const createUnElevenLabs: (userOptions?: ProviderOptions) => SpeechProvider< /** @see {@link https://elevenlabs.io/docs/developer-guides/models} */ "eleven_english_sts_v2" | "eleven_flash_v2" | "eleven_flash_v2_5" | "eleven_multilingual_sts_v2" | "eleven_multilingual_v2", UnElevenLabsOptions>; interface UnSpeechOptions { /** @experimental */ extraBody?: Record; } declare const createUnSpeech: (userOptions?: ProviderOptions) => SpeechProvider<`elevenlabs/${string}` | `koemotion/${string}` | `openai/${string}`, UnSpeechOptions>; declare const generateCRO: (model: string, { apiKey, baseURL, headers }: ProviderResult) => CommonRequestOptions; export { type ChatProvider, type EmbedProvider, type ModelProvider, type ProviderOptions, type ProviderResult, type SpeechProvider, type TranscriptionProvider, type UnElevenLabsOptions, type UnSpeechOptions, createGoogleGenerativeAI, createOllama, createOpenAI, createUnElevenLabs, createUnSpeech, generateCRO, ollama };