Skip to content

DeepgramSTTService Forcing HTTPS or WSS #4019

@jcbjoe

Description

@jcbjoe

pipecat version

0.0.105

Python version

3.11.5

Operating System

MacOS 26.2

Issue description

The new DeepgramSTTService implementation requires the base_url to be https or wss, if it is not it will prepend those protocols. When running Deepgram in an airgapped or private environment using https or wss is not necessary and adds additional overhead. So requiring https or wss is redundant and should be removed. The user should be able to pass the exact url without it being modified.

        if base_url:
            try:
                from deepgram import DeepgramClientEnvironment

                ws_url = base_url if base_url.startswith("wss://") else f"wss://{base_url}"
                http_url = base_url if base_url.startswith("https://") else f"https://{base_url}"
                environment = DeepgramClientEnvironment(
                    base=http_url,
                    production=ws_url,
                    agent=ws_url,
                )
                self._client = AsyncDeepgramClient(api_key=api_key, environment=environment)

Reproduction steps

Create DeepgramSTTService and set the base_url argument as http:// or ws://

Expected behavior

Allows the base_url that you pass without modification

Actual behavior

Guarantees the URL starts with https:// or wss://

Logs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions