<!--
 ⚠️  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) / TypeSafeAIProvider

# Interface: TypeSafeAIProvider\<TConfig\>

Type-safe AI provider interface with proper generic constraints

**`Template`**

Message type (defaults to TUniversalMessage for backward compatibility)

**`Template`**

Response type (defaults to TUniversalMessage for backward compatibility)

## Type parameters

| Name      | Type                               | Description                                                              |
| :-------- | :--------------------------------- | :----------------------------------------------------------------------- |
| `TConfig` | [`ProviderConfig`](ProviderConfig) | Provider configuration type (defaults to ProviderConfig for type safety) |

## Implemented by

- [`AbstractAIProvider`](../classes/AbstractAIProvider)

## Table of contents

### Properties

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

### Methods

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

## Properties

### name

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

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:30](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L30)

---

### version

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

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:31](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L31)

## Methods

### configure

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

#### Parameters

| Name     | Type      |
| :------- | :-------- |
| `config` | `TConfig` |

#### Returns

`void` \| `Promise`\<`void`\>

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:33](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L33)

---

### chat

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

#### Parameters

| Name       | Type                                                  |
| :--------- | :---------------------------------------------------- |
| `messages` | [`TUniversalMessage`](../modules#tuniversalmessage)[] |
| `options?` | [`IChatOptions`](IChatOptions)                        |

#### Returns

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

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:34](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L34)

---

### chatStream

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

#### Parameters

| Name       | Type                                                  |
| :--------- | :---------------------------------------------------- |
| `messages` | [`TUniversalMessage`](../modules#tuniversalmessage)[] |
| `options?` | [`IChatOptions`](IChatOptions)                        |

#### Returns

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

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:35](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L35)

---

### generateResponse

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

#### Parameters

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

#### Returns

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

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:36](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L36)

---

### generateStreamingResponse

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

#### Parameters

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

#### Returns

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

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:37](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L37)

---

### supportsTools

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

#### Returns

`boolean`

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:38](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L38)

---

### validateConfig

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

#### Returns

`boolean`

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:39](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L39)

---

### dispose

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

#### Returns

`Promise`\<`void`\>

#### Defined in

[packages/agents/src/abstracts/abstract-ai-provider.ts:40](https://github.com/woojubb/robota/blob/4f4c8a3197e92ddd43d12dc9186b0771983054c9/packages/agents/src/abstracts/abstract-ai-provider.ts#L40)
