Skip to content
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

Async File Python Code - Needs Update #222

Open
HuckMatt opened this issue Oct 5, 2021 · 3 comments
Open

Async File Python Code - Needs Update #222

HuckMatt opened this issue Oct 5, 2021 · 3 comments

Comments

@HuckMatt
Copy link

HuckMatt commented Oct 5, 2021

In the async file submission python code snippet, there are multiple areas where a boolean is expected in the params eg. 'detectPhrases': True,

The way the code snippet is currently written, when the params object is passed in the API request, it is still in the form of a Python dictionary object. Before sending in the request this object needs to be encoded so that the API reads the boolean values as a true boolean.

For example if params = {'detectPhrases': True} then the request:
response = requests.request("POST", url, headers=headers, data=payload, params=params) will return a status 400. The resulting params will be in the form https://api.symbl.ai/v1/process/video?detectPhrases=True

In this example the capitol 'True' will not be accepted by the API and return a status 400.

The correct param format needs to be in the form https://api.symbl.ai/v1/process/video?detectPhrases=true

In order to make this request in python the params object needs to be encoded properly. For example params = json.dumps(params), or in the request response = requests.request("POST", url, headers=headers, data=payload, params=json.dumps(params))

@ashish-patwal
Copy link

@HuckMatt i would like to work on this issue . Can you please guide me to the files that needs correction ?

@atom19-i
Copy link
Contributor

atom19-i commented Oct 25, 2021

@visharma-symbl please review my PR.

@atom19-i
Copy link
Contributor

@Akankshabhasin please review my PR..

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

No branches or pull requests

3 participants