OpenAiChatProvider class
Chat provider adapter for OpenAI-compatible chat completions.
- Inheritance
-
- Object
- ChatProvider
- OpenAiChatProvider
Constructors
- OpenAiChatProvider({String? apiKey, String? bearerToken, Uri? endpoint, AiHttpClient? httpClient})
- Creates an OpenAI chat provider using either an API key or bearer token.
Properties
- apiKey → String?
-
final
- bearerToken → String?
-
final
- displayName → String
-
Human-readable provider name.
no setteroverride
- endpoint → Uri
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- httpClient → AiHttpClient
-
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 chat events for the request.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited