ChatSession class final

A back-and-forth chat with a generative model.

Records messages sent and received in history. The history will always record the content from the first candidate in the GenerateContentResponse, other candidates may be available on the returned response.

Properties

hashCode int
The hash code for this object.
no setterinherited
history Iterable<Content>
The content that has been successfully sent to, or received from, the generative model.
no setter
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
sendMessage(Content message) Future<GenerateContentResponse>
Sends message to the model as a continuation of the chat history.
sendMessageStream(Content message) Stream<GenerateContentResponse>
Continues the chat with a new message.
toString() String
A string representation of this object.
inherited

Operators

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