miniature-nail-35141
10/26/2025, 5:42 PMtall-airline-16756
10/26/2025, 5:42 PMtall-airline-16756
10/26/2025, 5:43 PMcapabilities attribute on a tuple instead of a proper TTS instance. This usually occurs when a function that’s supposed to return a TTS object ends up returning a tuple instead.
Let’s walk through some steps to help you resolve this:
1. First, check the function that initializes or returns the TTS object. Make sure it’s returning the TTS instance directly and not a tuple. For example:
# Incorrect - returns a tuple
def create_tts():
tts = gemini.TTS(model="gemini-2.5-flash-preview-tts")
return tts, "success" # This creates a tuple!
# Correct - returns the TTS instance
def create_tts():
return gemini.TTS(model="gemini-2.5-flash-preview-tts")
1. Next, verify that the TTS object is properly set up in your agent configuration. For example:
agent = Agent(
tts=gemini.TTS(
model="gemini-2.5-flash-preview-tts",
voice_name="Kore"
)
)
1. It can also help to add some debugging statements to check the type of the object before you access `capabilities`:
print(type(your_tts_object)) # This should show a TTS instance, not a tuple
By tracing where the tuple might be getting created and ensuring you’re working with the correct TTS object, you’ll be able to fix this issue. If you’d like, I’m here to help you further—just let me know!
Sources: examples/other/text-to-speech/rime_tts.py