OpenAIClient class
OpenAI implementation of AIClient.
Constructors
-
OpenAIClient({required String model, required double? temperature, List<
Map< ? tools, required String systemPrompt, String? apiKey, required List<String, dynamic> >InternalMessage> getMessages()}) - Creates an OpenAI chat-completions client.
Properties
- apiKey → String?
-
Provider API key.
finalinherited
-
getMessages
↔ List<
InternalMessage> Function() -
Callback that returns the current conversation history.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- model → String
-
Model identifier used by the completion provider.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- systemPrompt → String
-
System prompt sent with each completion request.
finalinherited
- temperature → double?
-
Sampling temperature for completions.
finalinherited
-
tools
→ List<
Map< ?String, dynamic> > -
Optional tool definitions available to the model.
finalinherited
Methods
-
complete(
String prompt) → Future< Completion?> -
Completes a user prompt.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateTool(
Completion response) → void - Updates a completion choice with tool metadata when a tool was selected.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited