Skip to content

@chinmaymk/aikit v0.0.40


@chinmaymk/aikit / createOpenAI

Function: createOpenAI()

createOpenAI(options): OpenAIProvider

Defined in: factory.ts:60

Creates an OpenAI provider using the Chat Completions API.

Parameters

options

WithApiKey<OpenAIOptions>

Configuration options with required API key

Returns

OpenAIProvider

OpenAI streaming generation provider function

Example

typescript
const openai = createOpenAI({
  apiKey: 'sk-...',
  model: 'gpt-4o',
  temperature: 0.7
});

Released under the MIT License.