com.google.mlkit.genai.agent
Interfaces
AgentEvent |
Events emitted by the Agent during an execution session. |
AgentSession |
A scoped session handle representing an ongoing multi-turn conversational thread with an |
Classes
Agent |
Represents an AI Agent guided by system instructions and equipped with executable tools. |
Agent.Builder |
Builder for constructing |
AgentEvent.FunctionCall |
Emitted immediately before a function is invoked by the runner. |
AgentEvent.FunctionResponse |
Emitted immediately after a function invocation completes. |
AgentEvent.TextMessage |
The text message generated by the agent for the user. |
AgentRunner |
Manages agent execution sessions. |
AgentTool |
Base class for tools that the |
Objects
AppFunctionAgentTools |
Utility for discovering in-app Android AppFunctions and exposing them as |
Extension functions summary
Flow<String> |
Filters and extracts completed text messages from non-partial |
Flow<String> |
Filters and extracts streaming text token chunks from partial |
Extension functions
textMessages
fun Flow<AgentEvent>.textMessages(): Flow<String>
Filters and extracts completed text messages from non-partial AgentEvent.TextMessage events in this flow.
Convenience operator for standard text chat UIs or callers that display full text responses once generation finishes.
textTokens
fun Flow<AgentEvent>.textTokens(): Flow<String>
Filters and extracts streaming text token chunks from partial 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.