AsyncChat

public class AsyncChat extends ChatBase

An async chat session with a generative model.

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

Functions

Link copied to clipboard
public ImmutableList<Content> getHistory(boolean curated)
Returns the chat history.
Link copied to clipboard
Asynchronously sends a message to the model in the current multi-turn chat session and returns the model's response.
Link copied to clipboard
Asynchronously 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.