UNPKG

@aihubmix/ai-sdk-provider

Version:

> **🎉 10% discount!** Added app-code; this way, requesting all models through ai-sdk offers a 10% discount.

51 lines (47 loc) • 2.36 kB
import { ProviderV2, LanguageModelV2, EmbeddingModelV2, ImageModelV2, TranscriptionModelV2, SpeechModelV2 } from '@ai-sdk/provider'; import { FetchFunction } from '@ai-sdk/provider-utils'; import { z } from 'zod'; import { OpenAIProviderSettings } from '@ai-sdk/openai'; declare const WebSearchPreviewParameters: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>; declare function webSearchPreviewTool({ searchContextSize, userLocation, }?: { searchContextSize?: 'low' | 'medium' | 'high'; userLocation?: { type?: 'approximate'; city?: string; region?: string; country?: string; timezone?: string; }; }): { type: 'provider-defined'; id: 'aihubmix.web_search_preview'; args: {}; parameters: typeof WebSearchPreviewParameters; }; declare const aihubmixTools: { webSearchPreview: typeof webSearchPreviewTool; }; interface AihubmixProvider extends ProviderV2 { (deploymentId: string, settings?: OpenAIProviderSettings): LanguageModelV2; languageModel(deploymentId: string, settings?: OpenAIProviderSettings): LanguageModelV2; chat(deploymentId: string, settings?: OpenAIProviderSettings): LanguageModelV2; responses(deploymentId: string): LanguageModelV2; completion(deploymentId: string, settings?: OpenAIProviderSettings): LanguageModelV2; embedding(deploymentId: string, settings?: OpenAIProviderSettings): EmbeddingModelV2<string>; image(deploymentId: string, settings?: OpenAIProviderSettings): ImageModelV2; imageModel(deploymentId: string, settings?: OpenAIProviderSettings): ImageModelV2; textEmbedding(deploymentId: string, settings?: OpenAIProviderSettings): EmbeddingModelV2<string>; textEmbeddingModel(deploymentId: string, settings?: OpenAIProviderSettings): EmbeddingModelV2<string>; transcription(deploymentId: string): TranscriptionModelV2; speech(deploymentId: string): SpeechModelV2; speechModel(deploymentId: string): SpeechModelV2; tools: typeof aihubmixTools; } interface AihubmixProviderSettings { apiKey?: string; fetch?: FetchFunction; compatibility?: 'strict' | 'compatible'; } declare function createAihubmix(options?: AihubmixProviderSettings): AihubmixProvider; declare const aihubmix: AihubmixProvider; export { type AihubmixProvider, type AihubmixProviderSettings, aihubmix, createAihubmix };