UNPKG

@ai-sdk/openai

Version:

The **[OpenAI provider](https://ai-sdk.dev/providers/ai-sdk-providers/openai)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for the OpenAI chat and completion APIs and embedding model support for the OpenAI embeddings API.

19 lines (17 loc) 600 B
import { FetchFunction } from '@ai-sdk/provider-utils'; export type OpenAIConfig = { provider: string; url: (options: { modelId: string; path: string }) => string; headers: () => Record<string, string | undefined>; fetch?: FetchFunction; generateId?: () => string; /** * File ID prefixes used to identify file IDs in Responses API. * When undefined, all file data is treated as base64 content. * * Examples: * - OpenAI: ['file-'] for IDs like 'file-abc123' * - Azure OpenAI: ['assistant-'] for IDs like 'assistant-abc123' */ fileIdPrefixes?: readonly string[]; };