-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Sarvam STT/STTT WS implementation #2821
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
Conversation
src/pipecat/services/sarvam/stt.py
Outdated
| raise Exception(f"Missing module: {e}") | ||
|
|
||
|
|
||
| class TranscriptionMetrics(BaseModel): |
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.
Are these types defined in your python package by any chance?
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.
Yes, these types are defined in the sarvamai package.
However, the rest of these classes aren't needed as they are handled internally by the package. I have updated the code accordingly.
markbackman
left a comment
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.
You'll want to include a set_language() function so that developers can change the language. Here's how this is done in Deepgram:
async def set_language(self, language: Language):
"""Set the recognition language and reconnect.
Args:
language: The language to use for speech recognition.
"""
logger.info(f"Switching STT language to: [{language}]")
self._settings["language"] = language
await self._disconnect()
await self._connect()
Note the disconnect and reconnect which is needed to reinitialize the language. You may need that, but it's up to what your service requires to swap languages.
|
Looking good so far. A few additional things:
|
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
I have made the changes you had requested. Looking forward to the next steps. |
markbackman
left a comment
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.
LGTM! Thanks for working through the comments with me. Congrats 🎉
Sarvam STT/STTT WS implementation
Implemented a new Sarvam speech-to-text service which contains speech-to-text and speech-to-text-translate streaming websocket.