ChatEvent class sealed

Is the type received by the chat stream
It can be a request or a response
The request just contains the message
The response contains the message and the resource usage
Example:

chat.stream.listen((event) {
  if (event is RequestChatEvent) {
    print(event.message.message);
  } else if (event is ResponseChatEvent) {
    print(event.response.choices.first.message);
    print(event.usage.totalTokens);
  }
Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<T>({required T request(RequestChatEvent), required T response(ResponseChatEvent)}) → T

Operators

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