A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://firebase.google.com/docs/reference/kotlin/com/google/firebase/ai/Chat below:

Chat | Firebase SDKs for Android

Stay organized with collections Save and categorize content based on your preferences.

Chat
class Chat

Representation of a multi-turn interaction with a model.

Captures and stores the history of communication in memory, and provides it as context with each new message.

Note: This object is not thread-safe, and calling sendMessage multiple times without waiting for a response will throw an InvalidStateException.

Summary Public properties MutableList<Content> history

The previous content from the chat that has been successfully sent and received from the model.

Public functions sendMessage
suspend fun sendMessage(prompt: Bitmap): GenerateContentResponse

Sends a message using the existing history of this chat as context and the provided image prompt.

If successful, the message and response will be added to the history. If unsuccessful, history will remain unchanged.

Parameters prompt: Bitmap

The input that, together with the history, will be given to the model as the prompt.

sendMessage
suspend fun sendMessage(prompt: Content): GenerateContentResponse

Sends a message using the provided prompt; automatically providing the existing history as context.

If successful, the message and response will be added to the history. If unsuccessful, history will remain unchanged.

Parameters prompt: Content

The input that, together with the history, will be given to the model as the prompt.

sendMessage
suspend fun sendMessage(prompt: String): GenerateContentResponse

Sends a message using the provided text prompt; automatically providing the existing history as context.

If successful, the message and response will be added to the history. If unsuccessful, history will remain unchanged.

Parameters prompt: String

The input that, together with the history, will be given to the model as the prompt.

sendMessageStream
fun sendMessageStream(prompt: Bitmap): Flow<GenerateContentResponse>

Sends a message using the existing history of this chat as context and the provided image prompt.

The response from the model is returned as a stream.

If successful, the message and response will be added to the history. If unsuccessful, history will remain unchanged.

Parameters prompt: Bitmap

The input that, together with the history, will be given to the model as the prompt.

sendMessageStream
fun sendMessageStream(prompt: Content): Flow<GenerateContentResponse>

Sends a message using the existing history of this chat as context and the provided Content prompt.

The response from the model is returned as a stream.

If successful, the message and response will be added to the history. If unsuccessful, history will remain unchanged.

Parameters prompt: Content

The input that, together with the history, will be given to the model as the prompt.

sendMessageStream
fun sendMessageStream(prompt: String): Flow<GenerateContentResponse>

Sends a message using the existing history of this chat as context and the provided text prompt.

The response from the model is returned as a stream.

If successful, the message and response will be added to the history. If unsuccessful, history will remain unchanged.

Parameters prompt: String

The input(s) that, together with the history, will be given to the model as the prompt.

Public properties history
val historyMutableList<Content>

The previous content from the chat that has been successfully sent and received from the model. This will be provided to the model for each message sent (as context for the discussion).

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-21 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4