TextAi class

Pollinations API TextAi class. This class is used to generate text using the Pollinations API.

Constructors

TextAi({String model = "openai", String system = "", bool contextual = false, List<Message> messages = const [], dynamic seed = "random", bool private = false, String reasoningEffort = "low", bool jsonMode = false, String referrer = "pollinations.py"})
Constructor for TextAi class.

Properties

contextual bool
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
images List<Message>?
getter/setter pair
jsonMode bool
getter/setter pair
messages List<Message>
getter/setter pair
model String
getter/setter pair
private bool
getter/setter pair
prompt String?
getter/setter pair
reasoningEffort String
getter/setter pair
referrer String
getter/setter pair
request Request?
getter/setter pair
response ↔ dynamic
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
seed ↔ dynamic
getter/setter pair
system String
getter/setter pair
time DateTime?
getter/setter pair
timestamp DateTime
getter/setter pair

Methods

call({String? prompt, bool display = false, bool encode = false}) Future<TextAi>
Calls the Pollinations API to generate text based on the provided prompt.
image(dynamic file) TextAi
Add images to images list of the TextAi object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() String
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

models() Future<List<String>>
Get the list of available models from the Pollinations API. @return A Future that resolves to a list of models. Note: This method is static and can be called without creating an instance of TextAi.