Skip to content

@chinmaymk/aikit v0.0.40


@chinmaymk/aikit / openai

Function: openai()

openai(messages, config): AsyncIterable<StreamChunk>

Defined in: providers/openai_completions.ts:67

Direct OpenAI function - no configuration step needed

Parameters

messages

Message[]

config

WithApiKey<OpenAIOptions>

Returns

AsyncIterable<StreamChunk>

Example

typescript
const result = await collectDeltas(
  openai({ apiKey: '...', model: 'gpt-4o' }, [userText('Hello')])
);

Released under the MIT License.