Build a streaming agent¶
构建流式传输智能体¶
The Agent Development Kit (ADK) enables real-time, interactive experiences with your AI agents through streaming. This allows for features like live voice conversations, real-time tool use, and continuous updates from your agent.
智能体开发工具包 (ADK) 通过流式传输实现与AI智能体的实时、交互式体验。这支持实时语音对话、实时工具使用以及来自智能体的持续更新等功能。
This page provides quickstart examples to get you up and running with streaming capabilities in both Python and Java ADK.
本页面提供了快速入门示例,帮助您在 Python 和 Java ADK 中使用流式传输功能。
-
Python ADK: Streaming agent
This example demonstrates how to set up a basic streaming interaction with an agent using Python ADK. It typically involves using the
Runner.run_live()method and handling asynchronous events.此示例演示了如何使用 Python ADK 设置与智能体的基本流式传输交互。通常涉及使用
Runner.run_live()方法并处理异步事件。
-
Java ADK: Streaming agent
This example demonstrates how to set up a basic streaming interaction with an agent using Java ADK. It involves using the
Runner.runLive()method, aLiveRequestQueue, and handling ofFlowable<Event>stream.此示例演示了如何使用 Java ADK 设置与智能体的基本流式传输交互。涉及使用
Runner.runLive()方法、LiveRequestQueue和处理Flowable<Event>流。