Sub-agent not working for voice agents
I'm trying to create an agent with 2 sub-agents and run it on voice. But I'm facing an issue where the agent stops replying on voice when the step related to sub-agent transfer gets executed.
It is working completely fine when testing on text. I'm using gemini 2.0 flash-exp as the model for root agent as well as both the sub-agents.
Hi @saurabh-emvo , do you use adk web for testing? Do you see the transfer calls in the UI?
we have tested it on adk web
it works fine with text given the ss of the same
but it doesn't work with voice this error is shown
Error during live websocket communication: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.
Traceback (most recent call last):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/cli/fast_api.py", line 753, in agent_live_run
task.result()
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/cli/fast_api.py", line 726, in forward_events
async for event in runner.run_live(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/runners.py", line 296, in run_live
async for event in invocation_context.agent.run_live(invocation_context):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/agents/base_agent.py", line 160, in run_live
async for event in self._run_live_impl(ctx):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/agents/llm_agent.py", line 254, in _run_live_impl
async for event in self._llm_flow.run_live(ctx):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 106, in run_live
async for event in self._receive_from_model(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 214, in _receive_from_model
async for event in self._postprocess_live(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 401, in _postprocess_live
async for item in agent_to_run.run_live(invocation_context):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/agents/base_agent.py", line 160, in run_live
async for event in self._run_live_impl(ctx):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/agents/llm_agent.py", line 254, in _run_live_impl
async for event in self._llm_flow.run_live(ctx):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 91, in run_live
audio_transcriber = audio_transcriber.AudioTranscriber()
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/audio_transcriber.py", line 29, in __init__
self.client = speech.SpeechClient()
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/client.py", line 701, in __init__
self._transport = transport_init(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/transports/grpc.py", line 235, in __init__
super().__init__(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/transports/base.py", line 100, in __init__
credentials, _ = google.auth.default(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/auth/_default.py", line 685, in default
raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.
Traceback (most recent call last):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/cli/fast_api.py", line 753, in agent_live_run
task.result()
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/cli/fast_api.py", line 726, in forward_events
async for event in runner.run_live(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/runners.py", line 296, in run_live
async for event in invocation_context.agent.run_live(invocation_context):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/agents/base_agent.py", line 160, in run_live
async for event in self._run_live_impl(ctx):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/agents/llm_agent.py", line 254, in _run_live_impl
async for event in self._llm_flow.run_live(ctx):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 106, in run_live
async for event in self._receive_from_model(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 214, in _receive_from_model
async for event in self._postprocess_live(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 401, in _postprocess_live
async for item in agent_to_run.run_live(invocation_context):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/agents/base_agent.py", line 160, in run_live
async for event in self._run_live_impl(ctx):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/agents/llm_agent.py", line 254, in _run_live_impl
async for event in self._llm_flow.run_live(ctx):
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 91, in run_live
audio_transcriber = audio_transcriber.AudioTranscriber()
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/adk/flows/llm_flows/audio_transcriber.py", line 29, in __init__
self.client = speech.SpeechClient()
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/client.py", line 701, in __init__
self._transport = transport_init(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/transports/grpc.py", line 235, in __init__
super().__init__(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/cloud/speech_v1/services/speech/transports/base.py", line 100, in __init__
credentials, _ = google.auth.default(
File "/Users/arkodeepchatterjee/Desktop/adk-voice/adk/lib/python3.9/site-packages/google/auth/_default.py", line 685, in default
raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.
the same error comes up when testing it with voice and ws with telephony
Seems like your cloud credentials are not setup, could you checkout https://cloud.google.com/docs/authentication/external/set-up-adc
we have setup the gemini api key do we need to setup anything else separately??
@hangfei to help take a look, maybe this helps?https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment
does the code use any other gcp services?? i thought it only needed gemini access
If you are using Google vertex AI, then follow this: https://google.github.io/adk-docs/get-started/quickstart/#env
@hangfei please look into this asap we have a product launch coming up and urgently need this resolved
we are also not using vertex ai just the google genai sdk with gemini api
The streaming(live) has the same auth as regular non-live agents. So you should not see auth issues when switching to live or from text to audio.
The error looks pretty weird.
Could you share the full steps to reproduce the errors?
same here, was this solved? i am getting the same error as well @hangfei
+1 I am alo getting the same error @hangfei @wyf7107
getting the same error.
I was initially getting this as well. After carefully reviewing the docs, I was able to resolve. The issue was that:
- In https://google.github.io/adk-docs/get-started/quickstart/#set-up-the-model
- The instruction says: Authenticate to Google Cloud from the terminal by running
gcloud auth login
- The instruction says: Authenticate to Google Cloud from the terminal by running
- In https://cloud.google.com/docs/authentication/set-up-adc-local-dev-environment
- The instruction says: If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login. This is what needs to be done for testing this out on the laptop.
- The instruction says: If you're using a local shell, then create local authentication credentials for your user account:
@hangfei : Might be helpful to update the docs!
Should be CLOSED, based on this update: https://github.com/google/adk-docs/pull/615
Per @joefernandez closing issue.