OpenAiCompatibleProvider class

Talks to any endpoint exposing POST {base-url}/chat/completions.

That covers OpenAI itself plus the many services and local runtimes that copied its shape — OpenRouter, Groq, Together, DeepSeek, Ollama — so one adapter serves most of the ecosystem.

Inheritance

Constructors

OpenAiCompatibleProvider(AiConfig config, {Dio? client})
Creates an OpenAI-compatible 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