AnthropicProvider class

Talks to Anthropic's Messages API.

Kept separate from the OpenAI adapter because the shapes genuinely differ: authentication is x-api-key rather than a bearer token, tools are declared with input_schema instead of a nested function object, tool arguments arrive already parsed, and the response is a list of typed content blocks.

Inheritance

Constructors

AnthropicProvider(AiConfig config, {Dio? client})
Creates an Anthropic provider.

Properties

config AiConfig
Configuration this provider was built from.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
name String
Human readable name, used in errors and in doctor output.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

complete({required String context, required String prompt}) Future<AiReply>
Asks the model to map prompt to an action.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post(String url, Map<String, dynamic> body, Map<String, String> headers) Future<Map<String, dynamic>>
POSTs body to url and returns the decoded map.
inherited
rewrite({required String instruction, required String text}) Future<String>
Asks the model to rewrite text according to instruction.
override
toString() String
A string representation of this object.
inherited

Operators

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