<!--
 ⚠️  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
-->

[agents](../../) / [Exports](../modules) / IAIProvider

# Interface: IAIProvider

Provider-agnostic AI Provider interface
This interface uses only TUniversalMessage types and avoids provider-specific types

## Table of contents

### Properties

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

### Methods

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

## Properties

### name

• `Readonly` **name**: `string`

Provider identifier

#### Defined in

[packages/agents/src/interfaces/provider.ts:156](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L156)

---

### version

• `Readonly` **version**: `string`

Provider version

#### Defined in

[packages/agents/src/interfaces/provider.ts:158](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L158)

## Methods

### chat

▸ **chat**(`messages`, `options?`): `Promise`\<[`TUniversalMessage`](../modules#tuniversalmessage)\>

Generate response from AI model using TUniversalMessage

#### Parameters

| Name       | Type                                                  | Description                                          |
| :--------- | :---------------------------------------------------- | :--------------------------------------------------- |
| `messages` | [`TUniversalMessage`](../modules#tuniversalmessage)[] | Array of TUniversalMessage from conversation history |
| `options?` | [`IChatOptions`](IChatOptions)                        | Chat options including tools, model settings, etc.   |

#### Returns

`Promise`\<[`TUniversalMessage`](../modules#tuniversalmessage)\>

Promise resolving to a TUniversalMessage response

#### Defined in

[packages/agents/src/interfaces/provider.ts:166](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L166)

---

### chatStream

▸ **chatStream**(`messages`, `options?`): `AsyncIterable`\<[`TUniversalMessage`](../modules#tuniversalmessage), `any`, `any`\>

Generate streaming response from AI model using TUniversalMessage

#### Parameters

| Name       | Type                                                  | Description                                          |
| :--------- | :---------------------------------------------------- | :--------------------------------------------------- |
| `messages` | [`TUniversalMessage`](../modules#tuniversalmessage)[] | Array of TUniversalMessage from conversation history |
| `options?` | [`IChatOptions`](IChatOptions)                        | Chat options including tools, model settings, etc.   |

#### Returns

`AsyncIterable`\<[`TUniversalMessage`](../modules#tuniversalmessage), `any`, `any`\>

AsyncIterable of TUniversalMessage chunks

#### Defined in

[packages/agents/src/interfaces/provider.ts:174](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L174)

---

### generateResponse

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

Generate response from AI model (raw provider response)

#### Parameters

| Name      | Type                                   | Description              |
| :-------- | :------------------------------------- | :----------------------- |
| `payload` | [`IProviderRequest`](IProviderRequest) | Provider request payload |

#### Returns

`Promise`\<[`IRawProviderResponse`](IRawProviderResponse)\>

Promise resolving to raw provider response

#### Defined in

[packages/agents/src/interfaces/provider.ts:181](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L181)

---

### generateStreamingResponse

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

Generate streaming response from AI model (raw provider response)

#### Parameters

| Name      | Type                                   | Description              |
| :-------- | :------------------------------------- | :----------------------- |
| `payload` | [`IProviderRequest`](IProviderRequest) | Provider request payload |

#### Returns

`AsyncIterable`\<[`IRawProviderResponse`](IRawProviderResponse), `any`, `any`\>

AsyncIterable of raw provider response chunks

#### Defined in

[packages/agents/src/interfaces/provider.ts:188](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L188)

---

### supportsTools

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

Check if the provider supports tool calling

#### Returns

`boolean`

true if tool calling is supported

#### Defined in

[packages/agents/src/interfaces/provider.ts:194](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L194)

---

### validateConfig

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

Validate provider configuration

#### Returns

`boolean`

true if configuration is valid

#### Defined in

[packages/agents/src/interfaces/provider.ts:200](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L200)

---

### dispose

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

Clean up resources when provider is no longer needed

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/interfaces/provider.ts:205](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L205)

---

### close

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

Close provider connections and cleanup resources

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/interfaces/provider.ts:210](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/interfaces/provider.ts#L210)
