OpenAiClient class
A simple OpenAI-style client (text + image) using HTTP.
- Implemented types
Constructors
- OpenAiClient({String? apiKey, String textModel = 'gpt-3.5-turbo', bool imageEndpointFallback = true})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageEndpointFallback → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textModel → String
-
final
Methods
-
generateFieldValue(
{required FieldType fieldType, String? context, Duration timeout = const Duration(seconds: 15)}) → Future< String> -
Generate a single field value given a field "type" (e.g., name, email, bio, product_description).
override
-
generateImageUrl(
{String prompt = 'A modern office workspace with natural light', Duration timeout = const Duration(seconds: 20)}) → Future< Uri> -
Generate an image URL given a prompt (you can return any fetchable image URL).
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited