My question: How can I start an AgentSession with ...
# agents
m
My question: How can I start an AgentSession with audio inputs and outputs disabled, and then turn them on later? Context - I’m trying to develop an Agent that can either • just chat with a user • chat and talk with the user And can toggle back and forth between the two states. I’m following the docs here (psuedocode of my implementation in the 🧵). I can get it working in all scenario but one: starting with just chat, and then moving to enabling audio. When I attempt to enable audio input and output for an AgentSession initiated with it disabled, I experience this error:
Cannot enable audio input when it's not set
. Thanks!
👍 1
Copy code
# When initiating the session -
session.start(
    ...,
    room_input_options=RoomInputOptions(
        text_enabled=False,
        audio_enabled=False,
        ...
    ),
    room_output_options=RoomOutputOptions(
        audio_enabled=False,
)
Copy code
# Called in an RPC method invoked by a user action -
session.input.set_audio_enabled(True)
session.output.set_audio_enabled(True)
n
@magnificent-van-28702 in those docs I think it's saying that if you start the session with audio_enabled=False that will disable it for the duration of the session. Looks like you have to start with audio_enabled=True and then you can toggle
👍 1
Did you try starting with the audio enabled = true and then toggling?
r
I like to do session.start with them enabled (so everything get initialllized) then disable what I don't want on the next line
👍 1
m
Will give a whirl, thanks guys ✈️
works, thanks again!
🎉 2