agents / Exports / TypeSafeAIProvider
Interface: TypeSafeAIProvider<TConfig, TMessage, TResponse>
Type-safe AI provider interface with proper generic constraints
Type parameters
| Name | Type | Description |
|---|---|---|
TConfig | ProviderConfig | Provider configuration type (defaults to ProviderConfig for type safety) |
TMessage | UniversalMessage | Message type (defaults to UniversalMessage for backward compatibility) |
TResponse | UniversalMessage | Response type (defaults to UniversalMessage for backward compatibility) |
Implemented by
Table of contents
Properties
Methods
Properties
name
• Readonly name: string
Defined in
packages/agents/src/abstracts/base-ai-provider.ts:19
version
• Readonly version: string
Defined in
packages/agents/src/abstracts/base-ai-provider.ts:20
Methods
configure
▸ configure(config): void | Promise<void>
Parameters
| Name | Type |
|---|---|
config | TConfig |
Returns
void | Promise<void>
Defined in
packages/agents/src/abstracts/base-ai-provider.ts:22
chat
▸ chat(messages, options?): Promise<TResponse>
Parameters
| Name | Type |
|---|---|
messages | TMessage[] |
options? | ChatOptions |
Returns
Promise<TResponse>
Defined in
packages/agents/src/abstracts/base-ai-provider.ts:23
chatStream
▸ chatStream(messages, options?): AsyncIterable<TResponse, any, any>
Parameters
| Name | Type |
|---|---|
messages | TMessage[] |
options? | ChatOptions |
Returns
AsyncIterable<TResponse, any, any>
Defined in
packages/agents/src/abstracts/base-ai-provider.ts:24
supportsTools
▸ supportsTools(): boolean
Returns
boolean
Defined in
packages/agents/src/abstracts/base-ai-provider.ts:25
validateConfig
▸ validateConfig(): boolean
Returns
boolean
Defined in
packages/agents/src/abstracts/base-ai-provider.ts:26
dispose
▸ dispose(): Promise<void>
Returns
Promise<void>