-
Notifications
You must be signed in to change notification settings - Fork 1.3k
add new room options #3417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add new room options #3417
Conversation
*, | ||
capture_run: Literal[True], | ||
room: NotGivenOr[rtc.Room] = NOT_GIVEN, | ||
room_options: NotGivenOr[room_io.RoomOptions | dict[str, Any]] = NOT_GIVEN, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the tricky thing with dict[str, Any] is that we don't have any typing. So most IDE will not suggest any auto-completion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I am not happy with this version, but it seems that there is no way to support both dataclasses/pydantic and typed dict without defining the options twice.
If we only support the first one, it will need to import a lot of xxxOptions to create the config...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the dict
input.
examples/voice_agents/basic_agent.py
Outdated
), | ||
room_output_options=RoomOutputOptions(transcription_enabled=True), | ||
room_options={ | ||
"audio_input": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what are your thoughts on importing room_io and then something like:
await session.start(
agent=MyAgent(),
room=ctx.room,
room_options=room_io.RoomOptions(
input=room_io.RoomInputOptions(...),
output=room_io.RoomOutputOptions(...),
)
)
or even:
await session.start(
agent=MyAgent(),
room=ctx.room,
room_options=room_io.RoomOptions(
input= {
"text_enabled": False,
"video_input": True,
},
output= {
"transcription_enabled": False
}
)
)
and in RoomOptions
, group together input and output options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I think the following makes sense
await session.start(
agent=MyAgent(),
room=ctx.room,
room_options=room_io.RoomOptions(
audio_input=room_io.AudioInputOptions(
# uncomment to enable the Krisp BVC noise cancellation
# noise_cancellation=noise_cancellation.BVC(),
),
audio_output=room_io.AudioOutputOptions(sample_rate=24000),
text_output=room_io.TextOutputOptions(sync_transcription=True),
),
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, seems much cleaner to organize this way.
the original
RoomInputOptions
andRoomOutputOptions
are compatible but marked as deprecated.