KeyboardSuggestionResponse class

A typed response for keyboard suggestions.

Example usage:

final response = await Syni.generate(SyniRequest(
  personaId: 'keyboard.v1',
  input: 'Hello, how are',
));
final suggestions = KeyboardSuggestionResponse.fromSyniResponse(response);
for (final suggestion in suggestions.suggestions) {
  print(suggestion.text);
}

Constructors

KeyboardSuggestionResponse({required List<Suggestion> suggestions, required SyniResponseMeta meta, KeyboardSuggestionMeta? keyboardMeta})
const
KeyboardSuggestionResponse.fromSyniResponse(SyniResponse response)
Creates a KeyboardSuggestionResponse from a raw SyniResponse.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
hasSuggestions bool
Whether there are any suggestions available.
no setter
keyboardMeta KeyboardSuggestionMeta?
Additional keyboard-specific metadata.
final
meta SyniResponseMeta
Response metadata from Syni.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suggestions List<Suggestion>
The list of suggestions.
final
topSuggestion Suggestion?
Gets the top suggestion, if available.
no setter

Methods

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