-
Notifications
You must be signed in to change notification settings - Fork 547
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
playai: create new client only upon exception #1371
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: ec8802d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -162,18 +162,20 @@ def __init__( | |||
self._opts = opts | |||
self._config = self._opts.tts_options | |||
self._mp3_decoder = utils.codecs.Mp3StreamDecoder() | |||
self._client: PlayHTAsyncClient | None = None |
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.
should we create it during init as well?something like ensure_client
@@ -194,6 +196,10 @@ async def _run(self) -> None: | |||
) | |||
except Exception as e: | |||
raise APIConnectionError() from e | |||
finally: | |||
if self._client is not None: |
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.
this would effectively be the same, no? if the issue is with retries, then we should be resetting only when an exception is caught
btw, should we be closing the client each time? if that creates the websocket, we might end up in the same place.
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.
We might need to change the logic for all TTS streaming providers because we're closing the WebSocket connection in the same way for every request across all providers.
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.
The PipelineAgent is creating a new stream for every synthesis, so this isn't the right fix.
Let's create a thread on Slack?
No description provided.