AnthropicChatProvider class

Chat provider adapter for Anthropic's Messages API.

Supports non-streaming messages through complete and Anthropic's native server-sent event stream through stream.

Inheritance

Constructors

AnthropicChatProvider({required String apiKey, Uri? endpoint, AiHttpClient? httpClient})
Creates an Anthropic chat provider using an API key.

Properties

apiKey String
Anthropic API key sent with the x-api-key header.
final
displayName String
Human-readable provider name.
no setteroverride
endpoint Uri
Anthropic Messages API endpoint.
final
hashCode int
The hash code for this object.
no setterinherited
httpClient AiHttpClient
HTTP transport used for provider requests.
final
id String
Stable provider id used for registration and lookup.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

complete(ChatRequest request) Future<ChatResult>
Executes a non-streaming completion request.
override
describe() Map<String, dynamic>
Returns a serializable description of the provider.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stream(ChatRequest request) Stream<ChatEvent>
Streams Anthropic message events.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited