Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This solution is a bit of a hack and bring some inconsistencies in the async api, but I feel like using webhook.site is even more of a hack, so I chose to do it this way, tell me if you have any suggestions.
Problem
some subfeatures are async (eg: speech to text async) but we have some providers that don't have any async api for it.
only sync. To make them behave asynchronously we get the response from the provider on launch, and send a request to webhook.site with the response from the provider with a random id.
in the get_results method, from the id we search in webhook.site logs and return the response from the logs. basically using webhook.site as a sort of temporary db.
Solution
the best would be to separate them into their own sync features (speech_to_text, simply) but in the mean time we can just return the response directly in the launch method, removing the 'get_results' method.