Skip to content
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

add-speech-to-text-in-chat #182

Merged
merged 2 commits into from
May 28, 2023

Conversation

YifeiShi99
Copy link
Contributor

add speech to text in chat page use Web Speech API, from issue #81

@vercel
Copy link

vercel bot commented May 28, 2023

Someone is attempting to deploy a commit to a Personal Account owned by @StanGirard on Vercel.

@StanGirard first needs to authorize it.

@vercel
Copy link

vercel bot commented May 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quiver ❌ Failed (Inspect) May 28, 2023 10:42pm

@StanGirard
Copy link
Collaborator

Thanks for the PR !

This is so cool. Can you please fix the issues that raised in the CI.

To find out you can run yarn run precommit or yarn run build

Copy link
Contributor

@mamadoudicko mamadoudicko left a comment

Choose a reason for hiding this comment

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

Fantastic job on the PR, @YifeiShi99!

This is a really cool feature. Well done!

Comment on lines 28 to 31
const SpeechRecognition =
(window as any).SpeechRecognition ||
(window as any).webkitSpeechRecognition;
const mic = new SpeechRecognition();
Copy link
Contributor

Choose a reason for hiding this comment

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

Just discovered @types/dom-speech-recognition, which can be a solution to the CI error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

have implement using @types/dom-speech-recognition, it seems like it did fix the CI error, thanks for the suggestion!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

*in the latest commit

Comment on lines 45 to 55
mic.onerror = (event: any) => {
console.log(event.error);
setIsListening(false);
};

mic.onresult = (event: any) => {
const interimTranscript =
event.results[event.results.length - 1][0].transcript;
setQuestion((prevQuestion) => prevQuestion + interimTranscript);
};

Copy link
Contributor

Choose a reason for hiding this comment

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

With the @types/dom-speech-recognition, we'll no longer need to manually type these events

const mic = new SpeechRecognition();

mic.continuous = true;
mic.interim = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to be interimResults instead of interim

Copy link
Contributor Author

Choose a reason for hiding this comment

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

has been fixed in the commit

Copy link
Contributor

@adityanandanx adityanandanx left a comment

Choose a reason for hiding this comment

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

Great PR.

Please implement the changes requested by @mamadoudicko and the fix the CI errors and this will be merged!

@YifeiShi99
Copy link
Contributor Author

thanks guys! have implement the changes requested by @mamadoudicko and fixed CI errors in new commit

@mamadoudicko
Copy link
Contributor

Well done @YifeiShi99!

Thank you

@StanGirard StanGirard closed this May 28, 2023
@StanGirard StanGirard reopened this May 28, 2023
@StanGirard StanGirard merged commit b92f5a7 into QuivrHQ:main May 28, 2023
2 checks passed
StanGirard pushed a commit that referenced this pull request Sep 12, 2023
* add-speech-to-text-in-chat

* implement change request and fix CI error
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.

None yet

4 participants