import { LanguageModelV1 } from '@ai-sdk/provider'; export { LanguageModelV1 } from '@ai-sdk/provider'; type VolcEngineChatModelId = string; interface VolcEngineChatSettings { /** Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this tokenizer tool to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass {"50256": -100} to prevent the <|endoftext|> token from being generated. */ logitBias?: Record; /** Return the log probabilities of the tokens. Including logprobs will increase the response size and can slow down response times. However, it can be useful to better understand how the model is behaving. Setting to true will return the log probabilities of the tokens that were generated. Setting to a number will return the log probabilities of the top n tokens that were generated. */ logprobs?: boolean | number; /** Whether to enable parallel function calling during tool use. Default to true. */ parallelToolCalls?: boolean; /** A unique identifier representing your end-user, which can help OpenRouter to monitor and detect abuse. Learn more. */ user?: string; /** * List of model IDs to try in order if the primary model fails, e.g. ["anthropic/claude-2","gryphe/mythomax-l2-13b"] */ models?: string[]; includeReasoning?: boolean; } type VolcEngineChatConfig = { provider: string; compatibility: "strict" | "compatible"; headers: () => Record; url: (options: { modelId: string; path: string; }) => string; fetch?: typeof fetch; extraBody?: Record; }; declare class VolcEngineChatLanguageModel implements LanguageModelV1 { readonly specificationVersion = "v1"; readonly defaultObjectGenerationMode = "tool"; readonly modelId: VolcEngineChatModelId; readonly settings: VolcEngineChatSettings; private readonly config; constructor(modelId: VolcEngineChatModelId, settings: VolcEngineChatSettings, config: VolcEngineChatConfig); get provider(): string; private getArgs; doGenerate(options: Parameters[0]): Promise>>; doStream(options: Parameters[0]): Promise>>; } type OpenRouterCompletionModelId = string & {}; interface OpenRouterCompletionSettings { /** Echo back the prompt in addition to the completion. */ echo?: boolean; /** Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this tokenizer tool to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass {"50256": -100} to prevent the <|endoftext|> token from being generated. */ logitBias?: Record; /** Return the log probabilities of the tokens. Including logprobs will increase the response size and can slow down response times. However, it can be useful to better understand how the model is behaving. Setting to true will return the log probabilities of the tokens that were generated. Setting to a number will return the log probabilities of the top n tokens that were generated. */ logprobs?: boolean | number; /** The suffix that comes after a completion of inserted text. */ suffix?: string; /** A unique identifier representing your end-user, which can help OpenRouter to monitor and detect abuse. Learn more. */ user?: string; /** * List of model IDs to try in order if the primary model fails, e.g. ["openai/gpt-4","anthropic/claude-2"] */ models?: string[]; includeReasoning?: boolean; } type OpenRouterCompletionConfig = { provider: string; compatibility: "strict" | "compatible"; headers: () => Record; url: (options: { modelId: string; path: string; }) => string; fetch?: typeof fetch; extraBody?: Record; }; declare class OpenRouterCompletionLanguageModel implements LanguageModelV1 { readonly specificationVersion = "v1"; readonly defaultObjectGenerationMode: undefined; readonly modelId: OpenRouterCompletionModelId; readonly settings: OpenRouterCompletionSettings; private readonly config; constructor(modelId: OpenRouterCompletionModelId, settings: OpenRouterCompletionSettings, config: OpenRouterCompletionConfig); get provider(): string; private getArgs; doGenerate(options: Parameters[0]): Promise>>; doStream(options: Parameters[0]): Promise>>; } interface VolcEngineProvider { (modelId: "openai/gpt-3.5-turbo-instruct", settings?: OpenRouterCompletionSettings): OpenRouterCompletionLanguageModel; (modelId: VolcEngineChatModelId, settings?: VolcEngineChatSettings): VolcEngineChatLanguageModel; languageModel(modelId: "openai/gpt-3.5-turbo-instruct", settings?: OpenRouterCompletionSettings): OpenRouterCompletionLanguageModel; languageModel(modelId: VolcEngineChatModelId, settings?: VolcEngineChatSettings): VolcEngineChatLanguageModel; /** Creates an OpenRouter chat model for text generation. */ chat(modelId: VolcEngineChatModelId, settings?: VolcEngineChatSettings): VolcEngineChatLanguageModel; /** Creates an OpenRouter completion model for text generation. */ completion(modelId: OpenRouterCompletionModelId, settings?: OpenRouterCompletionSettings): OpenRouterCompletionLanguageModel; } interface VolcEngineProviderSettings { /** Base URL for the OpenRouter API calls. */ baseURL?: string; /** @deprecated Use `baseURL` instead. */ baseUrl?: string; /** API key for authenticating requests. */ apiKey?: string; /** Custom headers to include in the requests. */ headers?: Record; /** OpenRouter compatibility mode. Should be set to `strict` when using the OpenRouter API, and `compatible` when using 3rd party providers. In `compatible` mode, newer information such as streamOptions are not being sent. Defaults to 'compatible'. */ compatibility?: "strict" | "compatible"; /** Custom fetch implementation. You can use it as a middleware to intercept requests, or to provide a custom fetch implementation for e.g. testing. */ fetch?: typeof fetch; /** A JSON object to send as the request body to access OpenRouter features & upstream provider features. */ extraBody?: Record; } /** Create an OpenRouter provider instance. */ declare function createVolcEngine(options?: VolcEngineProviderSettings): VolcEngineProvider; /** Default VolcEngine provider instance. It uses 'strict' compatibility mode. */ declare const volcEngine: VolcEngineProvider; /** @deprecated Use `createVolcEngine` instead. */ declare class VolcEngine { /** Use a different URL prefix for API calls, e.g. to use proxy servers. The default prefix is `https://ark.cn-beijing.volces.com/api/v3`. */ readonly baseURL: string; /** API key that is being send using the `Authorization` header. It defaults to the `VOLCENGINE_API_KEY` environment variable. */ readonly apiKey?: string; /** Custom headers to include in the requests. */ readonly headers?: Record; /** * Creates a new OpenRouter provider instance. */ constructor(options?: VolcEngineProviderSettings); private get baseConfig(); chat(modelId: VolcEngineChatModelId, settings?: VolcEngineChatSettings): VolcEngineChatLanguageModel; completion(modelId: OpenRouterCompletionModelId, settings?: OpenRouterCompletionSettings): OpenRouterCompletionLanguageModel; } type OpenRouterLanguageModel = LanguageModelV1; export { type OpenRouterLanguageModel, VolcEngine, type VolcEngineProvider, type VolcEngineProviderSettings, createVolcEngine, volcEngine };