Skip to content

Conversation

longcw
Copy link
Contributor

@longcw longcw commented Sep 12, 2025

the original RoomInputOptions and RoomOutputOptions are compatible but marked as deprecated.

*,
capture_run: Literal[True],
room: NotGivenOr[rtc.Room] = NOT_GIVEN,
room_options: NotGivenOr[room_io.RoomOptions | dict[str, Any]] = NOT_GIVEN,
Copy link
Member

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

Copy link
Contributor Author

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the dict input.

),
room_output_options=RoomOutputOptions(transcription_enabled=True),
room_options={
"audio_input": {
Copy link
Contributor

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

Copy link
Contributor Author

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),
        ),
    )

Copy link
Member

@davidzhao davidzhao left a 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.

@longcw longcw changed the title draft for the new room options add new room options Sep 22, 2025
@longcw longcw marked this pull request as ready for review September 22, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants