Skip to content

feat(backchannel): add agent backchannel#6130

Draft
chenghao-mou wants to merge 5 commits into
tina/expressive-modefrom
chenghao/feat/add-agent-backchannel-expressive-mode
Draft

feat(backchannel): add agent backchannel#6130
chenghao-mou wants to merge 5 commits into
tina/expressive-modefrom
chenghao/feat/add-agent-backchannel-expressive-mode

Conversation

@chenghao-mou

Copy link
Copy Markdown
Member

No description provided.

tts_instructions_template: Instructions | str
tts_instructions_append: str
audio_recognition_instructions_template: Instructions | str
backchannel: NotGivenOr[bool | list[str | AudioSource | BackchannelConfig] | BackchannelOptions]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i'm wondering if we could simplify these types somehow

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

claude suggested:

  # backchannel.py
+ BackchannelSource: TypeAlias = "str | AudioSource | BackchannelConfig"

  class BackchannelOptions(TypedDict, total=False):
      frequency: float
-     source: NotGivenOr[list[str | AudioSource | BackchannelConfig]]
+     source: list[BackchannelSource]

- DEFAULT_BACKCHANNEL_SOURCE: list[str | AudioSource | BackchannelConfig] = [...]
+ DEFAULT_BACKCHANNEL_SOURCE: list[BackchannelSource] = [...]

  def resolve_backchannel_options(
-     backchannel: NotGivenOr[bool | list[str | AudioSource | BackchannelConfig] | BackchannelOptions],
+     backchannel: NotGivenOr[bool | list[BackchannelSource] | BackchannelOptions],
  ) -> BackchannelOptions | None: ...

- def _as_config(entry: str | AudioSource | BackchannelConfig) -> BackchannelConfig: ...
+ def _as_config(entry: BackchannelSource) -> BackchannelConfig: ...
  # agent_session.py
  class ExpressiveOptions(TypedDict, total=False):
      ...
-     backchannel: NotGivenOr[bool | list[str | AudioSource | BackchannelConfig] | BackchannelOptions]
+     backchannel: bool | list[BackchannelSource] | BackchannelOptions

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good point

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.

2 participants