-
Notifications
You must be signed in to change notification settings - Fork 107
Add useTranscription hook #1109
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?
Conversation
|
size-limit report 📦
|
* ``` | ||
*/ | ||
export function useTranscriptions(opts?: UseTranscriptionsOptions) { | ||
const { participantIdentities, trackSids } = opts ?? {}; |
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.
doesn't adding these options expose an easy trap where you have
const agentTranscriptions = useTranscriptions({ participantIdentities: ['agent'] });
and
const userTranscriptions = useTranscriptions({ participantIdentities: ['user'] });
in two different locations and then they conflict on useTextStream
which can only be used once?
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 components implementation creates a registered handler cache that makes it possible to reuse streams across the app without running into that limitation
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.
ah ok that works. i do still think we should just make it easy for anyone to register multiple handlers but it's not a blocker to this PR
* ``` | ||
*/ | ||
export function useTranscriptions(opts?: UseTranscriptionsOptions) { | ||
const { participantIdentities, trackSids } = opts ?? {}; |
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.
ah ok that works. i do still think we should just make it easy for anyone to register multiple handlers but it's not a blocker to this PR
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.
should this also get adopted by useVoiceAssistant?
with filtering based on participant identites and track ids.