AiProvider class abstract
A model backend that can turn a natural-language request into an AiAction.
Two implementations ship with the CLI — an OpenAI-compatible one covering most hosted and local endpoints, and Anthropic's Messages API — because the two speak different wire formats for the same idea. Everything above this interface is provider-neutral.
- Implementers
Constructors
- AiProvider(AiConfig config)
-
Creates a provider bound to
config.
Properties
- config → AiConfig
-
Configuration this provider was built from.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Human readable name, used in errors and in
doctoroutput.no setter - 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
promptto an action. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rewrite(
{required String instruction, required String text}) → Future< String> -
Asks the model to rewrite
textaccording toinstruction. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
toolSchema
→ Map<
String, dynamic> -
The tool the model is asked to call, as a JSON Schema.
no setter
Constants
- toolDescription → const String
- Description of the tool exposed to the model.
- toolName → const String
- Name of the tool exposed to the model.