Change run async wrapper to use explicit arguments#128
Change run async wrapper to use explicit arguments#128J-Jaywalker wants to merge 3 commits intomasterfrom
Conversation
| """ | ||
| self._session_needs_closing = True | ||
|
|
||
| def run_synchronously(self, *args, timeout=None, **kwargs): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.