# AgentEventKt


```
public final class AgentEventKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/lang/String.html>` | `https://developers.google.com/android/reference/com/google/mlkit/genai/agent/AgentEventKt#(kotlinx.coroutines.flow.Flow).textMessages()(@https://developer.android.com/reference/androidx/annotation/NonNull.html https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/mlkit/genai/agent/AgentEvent> receiver)` Filters and extracts completed text messages from non-partial `https://developers.google.com/android/reference/com/google/mlkit/genai/agent/AgentEvent.TextMessage` events in this flow. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull.html https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developer.android.com/reference/java/lang/String.html>` | `https://developers.google.com/android/reference/com/google/mlkit/genai/agent/AgentEventKt#(kotlinx.coroutines.flow.Flow).textTokens()(@https://developer.android.com/reference/androidx/annotation/NonNull.html https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull.html https://developers.google.com/android/reference/com/google/mlkit/genai/agent/AgentEvent> receiver)` Filters and extracts streaming text token chunks from partial `https://developers.google.com/android/reference/com/google/mlkit/genai/agent/AgentEvent.TextMessage` events in this flow. |

## Public methods

### textMessages

```
public static final @NonNull Flow<@NonNull String> textMessages(@NonNull Flow<@NonNull AgentEvent> receiver)
```

Filters and extracts completed text messages from non-partial `https://developers.google.com/android/reference/com/google/mlkit/genai/agent/AgentEvent.TextMessage` events in this flow.

Convenience operator for standard text chat UIs or callers that display full text responses once generation finishes.

### textTokens

```
public static final @NonNull Flow<@NonNull String> textTokens(@NonNull Flow<@NonNull AgentEvent> receiver)
```

Filters and extracts streaming text token chunks from partial `https://developers.google.com/android/reference/com/google/mlkit/genai/agent/AgentEvent.TextMessage` events in this flow.

Convenience operator for standard text chat UIs (such as Jetpack Compose `Text`) that display incremental streaming text tokens as they arrive.