anthropic / Exports / AnthropicProvider
Class: AnthropicProvider
Anthropic provider implementation for Robota
IMPORTANT PROVIDER-SPECIFIC RULES:
- This provider MUST extend BaseAIProvider from @robota-sdk/agents
- Content handling for Anthropic API:
- When tool_calls are present: content MUST be null (not empty string)
- For regular assistant messages: content should be a string
- Use override keyword for all methods inherited from BaseAIProvider
- Provider-specific API behavior should be documented here
Hierarchy
unknown↳
AnthropicProvider
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new AnthropicProvider(options): AnthropicProvider
Parameters
| Name | Type |
|---|---|
options | AnthropicProviderOptions |
Returns
Overrides
BaseAIProvider.constructor
Defined in
Properties
name
• Readonly name: "anthropic"
Defined in
version
• Readonly version: "1.0.0"
Defined in
Methods
chat
▸ chat(messages, options?): Promise<RobotaUniversalMessage>
Generate response using UniversalMessage
Parameters
| Name | Type |
|---|---|
messages | RobotaUniversalMessage[] |
options? | any |
Returns
Promise<RobotaUniversalMessage>
Defined in
chatStream
▸ chatStream(messages, options?): AsyncIterable<RobotaUniversalMessage, any, any>
Generate streaming response using UniversalMessage
Parameters
| Name | Type |
|---|---|
messages | RobotaUniversalMessage[] |
options? | any |
Returns
AsyncIterable<RobotaUniversalMessage, any, any>
Defined in
supportsTools
▸ supportsTools(): boolean
Returns
boolean
Defined in
validateConfig
▸ validateConfig(): boolean
Returns
boolean
Defined in
dispose
▸ dispose(): Promise<void>
Returns
Promise<void>