Skip to content

Documentation / @agentick/openai / openai

Function: openai() ​

openai(config?): ModelClass

Defined in: openai.ts:508

Convenience factory for creating OpenAI model.

Returns a ModelClass that can be used as:

  • JSX component: <model temperature={0.9}><Agent /></model>
  • App config: createApp(Agent, { model })
  • Direct calls: await model.generate(input)

Parameters ​

config? ​

OpenAIAdapterConfig

Returns ​

ModelClass

Example ​

typescript
const model = openai({ model: 'gpt-4o' });

// As JSX
<model><MyAgent /></model>

// With createApp
const app = createApp(MyAgent, { model });

Released under the ISC License.