Skip to content

Change run async wrapper to use explicit arguments #128

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

J-Jaywalker
Copy link
Contributor

@J-Jaywalker J-Jaywalker commented Jun 6, 2025

Noticed after the microphone transcription example bugging out that we do some janky packing and unpacking of positional arguments in our client run and async run wrappers.

I implemented it initially for multichan dz but this can introduce an issue where channel_pairs and audiosettings get mixed up with each other.

This MR changes that so that calls to run_asynchronously and by extension, any run functions down the line now need explicit arguments (except for transcription config as this is always required).

This change should make it more obvious how to pass arguments at the cost of a few extra words typed.

@@ -632,13 +639,35 @@ def stop(self):
"""
self._session_needs_closing = True

def run_synchronously(self, *args, timeout=None, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

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

So you can't pass arbitrary keyword args any more -- but I presume nothing did. I suppose the original code was just so it wasn't necessary to change run_synchronously and self.run in step.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The transcribe_from_microphone example passed things in positionally before multichan dz borked it, but no use of args* AFAIK.

Hoping Dumitru and Tudor/anyone else more invested in the Python client says its fine and that no customers are passing things in this way.

Copy link
Contributor

@dumitrugutu dumitrugutu Jun 9, 2025

Choose a reason for hiding this comment

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

This is a breaking change. All our setups and examples -- both in this repo and in the docs -- expect the first argument to be audio, followed by transcription_config, then audio_settings.

We’ll need to bump the major version if we go ahead with this. That said, this issue is already addressed in the new SDK (yet to be released), so we should either release this as a major version or close it in favor of the new SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants