Skip to content

Conversation

@shreyas-sarvam
Copy link
Contributor

Implemented a new Sarvam speech-to-text service which contains speech-to-text and speech-to-text-translate streaming websocket.

@shreyas-sarvam shreyas-sarvam changed the title Sarvam STT/STTT WS implementation. Sarvam STT/STTT WS implementation Oct 9, 2025
raise Exception(f"Missing module: {e}")


class TranscriptionMetrics(BaseModel):
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@markbackman markbackman left a 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.

@markbackman
Copy link
Contributor

Looking good so far. A few additional things:

  1. Add a changelog entry, adding the new service
  2. Update your foundational examples to use your STT service (07z*)

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

❌ Patch coverage is 0% with 181 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipecat/services/sarvam/stt.py 0.00% 181 Missing ⚠️
Files with missing lines Coverage Δ
src/pipecat/services/sarvam/stt.py 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shreyas-sarvam
Copy link
Contributor Author

Looking good so far. A few additional things:

  1. Add a changelog entry, adding the new service
  2. Update your foundational examples to use your STT service (07z*)

I have made the changes you had requested. Looking forward to the next steps.

Copy link
Contributor

@markbackman markbackman left a 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 🎉

@markbackman markbackman merged commit 074d3ff into pipecat-ai:main Oct 31, 2025
10 checks passed
sivakumarai2828 pushed a commit to sivakumarai2828/pipecat-speech2speech that referenced this pull request Nov 18, 2025
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