You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A tutorial demonstrating how the ADK (Agent Development Kit) automatically configures **inputAudioTranscription** and **outputAudioTranscription** for single-agent live scenarios. This tutorial showcases that the feature now works for all live scenarios, not just multi-agent scenarios.
4
+
5
+
## What This Demonstrates
6
+
7
+
This tutorial verifies the feature change in `Runner.java` that enables automatic transcription configuration for all live scenarios:
8
+
9
+
**Before:** Only multi-agent scenarios got automatic transcription
10
+
```java
11
+
if (liveRequestQueue.isPresent() &&!this.agent.subAgents().isEmpty())
12
+
```
13
+
14
+
**After:** All live scenarios (including single-agent) get automatic transcription
15
+
```java
16
+
if (liveRequestQueue.isPresent())
17
+
```
18
+
19
+
When you use this single-agent with live audio, the ADK automatically configures:
20
+
-**inputAudioTranscription** - Transcribes user speech to text
21
+
-**outputAudioTranscription** - Transcribes agent speech to text
22
+
23
+
## Setup API Key
24
+
25
+
```shell
26
+
export GOOGLE_GENAI_API_KEY={YOUR-KEY}
27
+
```
28
+
29
+
## Go to Tutorial Directory
30
+
31
+
```shell
32
+
cd tutorials/live-audio-single-agent
33
+
```
34
+
35
+
## Running the Agent
36
+
37
+
Start the server:
38
+
39
+
```shell
40
+
mvn exec:java
41
+
```
42
+
43
+
This starts the ADK web server with a single weather agent (`weather_agent`) that supports live audio using the `gemini-2.0-flash-live-001` model.
44
+
45
+
## Usage
46
+
47
+
Once running, you can interact with the agent through:
48
+
-**Web interface:**`http://localhost:8080`
49
+
-**Agent name:**`weather_agent`
50
+
-**Try asking:** "What's the weather in Tokyo?" or "How's the weather in New York?"
51
+
52
+
### Testing with Live Audio
53
+
54
+
1. Open the web interface at `http://localhost:8080`
55
+
2. Enable your microphone
56
+
3. Speak to the agent: "What's the weather in Tokyo?"
57
+
4. The agent will:
58
+
- Automatically transcribe your speech to text (inputAudioTranscription)
59
+
- Process the request and call the `getWeather` tool
60
+
- Respond with audio (automatically transcribed via outputAudioTranscription)
61
+
62
+
## Learn More
63
+
64
+
See https://google.github.io/adk-docs/get-started/quickstart/#java for more information.
0 commit comments