Chat

public class Chat extends ChatBase

A chat session with a generative model.

This class provides a way to interact with a generative model in a multi-turn chat session. It keeps track of the chat history and uses it to provide context for subsequent messages.

Note: this class is NOT thread-safe.

Functions

Link copied to clipboard
public ImmutableList<Content> getHistory(boolean curated)
Returns the chat history.
Link copied to clipboard
Sends a message to the model in the current multi-turn chat session and returns the model's response.
Link copied to clipboard
Sends a message to the model in the current multi-turn chat session and returns a stream of responses.
Sends a message to the model in the current multi-turn chat session and returns the model's response.