public interface **StreamingCallback** Callback function to receive a streaming result.

### Public Method Summary

|---|---|
| void | [onNewFunctionCall](https://developers.google.com/android/reference/com/google/mlkit/genai/common/StreamingCallback#onNewFunctionCall(com.google.mlkit.genai.common.FunctionCall))(FunctionCall functionCall) Called when a new function call is available mid-stream. |
| abstract void | [onNewText](https://developers.google.com/android/reference/com/google/mlkit/genai/common/StreamingCallback#onNewText(java.lang.String))([String](https://developer.android.com/reference/java/lang/String.html) additionalText) Called when a new text is available. |
| void | [onNewThought](https://developers.google.com/android/reference/com/google/mlkit/genai/common/StreamingCallback#onNewThought(java.lang.String))([String](https://developer.android.com/reference/java/lang/String.html) additionalThought) Called when a new thought is available. |

## Public Methods

#### public void **onNewFunctionCall** (FunctionCall functionCall)

Called when a new function call is available mid-stream.

When streaming is enabled with tools declared, complete predicted function calls are
also conveyed in the terminal chunk upon turn completion. This callback allows
receiving and executing tools incrementally as they are predicted.

##### Parameters

| functionCall | the predicted function call. |
|---|---|

#### public abstract void **onNewText** ([String](https://developer.android.com/reference/java/lang/String.html) additionalText)

Called when a new text is available.

##### Parameters

| additionalText | the new text. |
|---|---|

#### public void **onNewThought** ([String](https://developer.android.com/reference/java/lang/String.html) additionalThought)

Called when a new thought is available.

##### Parameters

| additionalThought | the new thought text. |
|---|---|