<!--
 ⚠️  AUTO-GENERATED FILE - DO NOT EDIT MANUALLY
 This file is automatically generated by scripts/docs-generator.js
 To make changes, edit the source TypeScript files or update the generator script
-->

[openai](../../) / [Exports](../modules) / OpenAIProvider

# Class: OpenAIProvider

OpenAI provider implementation for Robota

Provides integration with OpenAI's GPT models following BaseAIProvider guidelines.
Uses OpenAI SDK native types internally for optimal performance and feature support.

## Hierarchy

- `AbstractAIProvider`

  ↳ **`OpenAIProvider`**

## Table of contents

### Constructors

- [constructor](OpenAIProvider#constructor)

### Properties

- [name](OpenAIProvider#name)
- [version](OpenAIProvider#version)

### Methods

- [configure](OpenAIProvider#configure)
- [generateResponse](OpenAIProvider#generateresponse)
- [generateStreamingResponse](OpenAIProvider#generatestreamingresponse)
- [chat](OpenAIProvider#chat)
- [chatStream](OpenAIProvider#chatstream)
- [supportsTools](OpenAIProvider#supportstools)
- [validateConfig](OpenAIProvider#validateconfig)
- [dispose](OpenAIProvider#dispose)

## Constructors

### constructor

• **new OpenAIProvider**(`options`): [`OpenAIProvider`](OpenAIProvider)

#### Parameters

| Name      | Type                                                             |
| :-------- | :--------------------------------------------------------------- |
| `options` | [`IOpenAIProviderOptions`](../interfaces/IOpenAIProviderOptions) |

#### Returns

[`OpenAIProvider`](OpenAIProvider)

#### Overrides

AbstractAIProvider.constructor

#### Defined in

[openai/src/provider.ts:35](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/provider.ts#L35)

## Properties

### name

• `Readonly` **name**: `"openai"`

#### Overrides

AbstractAIProvider.name

#### Defined in

[openai/src/provider.ts:27](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/provider.ts#L27)

---

### version

• `Readonly` **version**: `"1.0.0"`

#### Overrides

AbstractAIProvider.version

#### Defined in

[openai/src/provider.ts:28](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/provider.ts#L28)

## Methods

### configure

▸ **configure**(`config`): `Promise`\<`void`\>

Configure the provider with type-safe configuration

#### Parameters

| Name     | Type             |
| :------- | :--------------- |
| `config` | `ProviderConfig` |

#### Returns

`Promise`\<`void`\>

#### Inherited from

AbstractAIProvider.configure

#### Defined in

agents/dist/node/index.d.ts:3098

---

### generateResponse

▸ **generateResponse**(`payload`): `Promise`\<`IRawProviderResponse`\>

Provider-agnostic raw response API.

This is the canonical "raw payload" entrypoint required by the AIProvider contract.
The default implementation delegates to `chat()` and adapts the result into a
RawProviderResponse shape.

#### Parameters

| Name      | Type               |
| :-------- | :----------------- |
| `payload` | `IProviderRequest` |

#### Returns

`Promise`\<`IRawProviderResponse`\>

#### Inherited from

AbstractAIProvider.generateResponse

#### Defined in

agents/dist/node/index.d.ts:3120

---

### generateStreamingResponse

▸ **generateStreamingResponse**(`payload`): `AsyncIterable`\<`IRawProviderResponse`, `any`, `any`\>

Provider-agnostic raw streaming API.

If a provider does not implement chatStream, it does not support streaming.

#### Parameters

| Name      | Type               |
| :-------- | :----------------- |
| `payload` | `IProviderRequest` |

#### Returns

`AsyncIterable`\<`IRawProviderResponse`, `any`, `any`\>

#### Inherited from

AbstractAIProvider.generateStreamingResponse

#### Defined in

agents/dist/node/index.d.ts:3126

---

### chat

▸ **chat**(`messages`, `options?`): `Promise`\<`TUniversalMessage`\>

Generate response using TUniversalMessage

#### Parameters

| Name       | Type                  |
| :--------- | :-------------------- |
| `messages` | `TUniversalMessage`[] |
| `options?` | `IChatOptions`        |

#### Returns

`Promise`\<`TUniversalMessage`\>

#### Overrides

AbstractAIProvider.chat

#### Defined in

[openai/src/provider.ts:77](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/provider.ts#L77)

---

### chatStream

▸ **chatStream**(`messages`, `options?`): `AsyncIterable`\<`TUniversalMessage`, `any`, `any`\>

Generate streaming response using TUniversalMessage

#### Parameters

| Name       | Type                  |
| :--------- | :-------------------- |
| `messages` | `TUniversalMessage`[] |
| `options?` | `IChatOptions`        |

#### Returns

`AsyncIterable`\<`TUniversalMessage`, `any`, `any`\>

#### Overrides

AbstractAIProvider.chatStream

#### Defined in

[openai/src/provider.ts:144](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/provider.ts#L144)

---

### supportsTools

▸ **supportsTools**(): `boolean`

#### Returns

`boolean`

#### Overrides

AbstractAIProvider.supportsTools

#### Defined in

[openai/src/provider.ts:212](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/provider.ts#L212)

---

### validateConfig

▸ **validateConfig**(): `boolean`

#### Returns

`boolean`

#### Overrides

AbstractAIProvider.validateConfig

#### Defined in

[openai/src/provider.ts:216](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/provider.ts#L216)

---

### dispose

▸ **dispose**(): `Promise`\<`void`\>

#### Returns

`Promise`\<`void`\>

#### Overrides

AbstractAIProvider.dispose

#### Defined in

[openai/src/provider.ts:220](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/openai/src/provider.ts#L220)
