Skip to content

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add useTranscription hook #1109

wants to merge 4 commits into from

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Mar 27, 2025

with filtering based on participant identites and track ids.

Copy link

changeset-bot bot commented Mar 27, 2025

⚠️ No Changeset found

Latest commit: df7aad7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@lukasIO lukasIO mentioned this pull request Mar 27, 2025
Copy link
Contributor

github-actions bot commented Mar 27, 2025

size-limit report 📦

Path Size
LiveKitRoom only 5.99 KB (0%)
LiveKitRoom with VideoConference 29.9 KB (+0.16% 🔺)
All exports 37.16 KB (+0.39% 🔺)

@lukasIO lukasIO requested a review from bcherry March 29, 2025 07:59
* ```
*/
export function useTranscriptions(opts?: UseTranscriptionsOptions) {
const { participantIdentities, trackSids } = opts ?? {};
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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 ?? {};
Copy link
Contributor

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

Copy link
Contributor

@bcherry bcherry left a 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?

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