We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ce31f7 commit b6a0993Copy full SHA for b6a0993
src/translations.py
@@ -20,6 +20,6 @@ def translate_with_azure(text, from_lang, to_lang):
20
21
request = requests.post(url, params=params, headers=headers, json=body)
22
response = request.json()
23
- if (type(response) is dict) and (err := response.get("error", None)):
+ if isinstance(response, dict) and (err := response.get("error", None)):
24
return None, err["message"], "AZURE"
25
return response[0]["translations"][0]["text"], None, "AZURE"
0 commit comments