'python API cant show non English language of list intents API in Dialogflow v2
I have written python API that can interact with Dialogflow engine and return me the list of intents of Dialogflow. The code is as follows:
def get(self, intent_id=None, get_child=None):
try:
print("ManageIntents get method api is called")
global global_intent_list
global is_parent
if get_child is not None:
return jsonify(self.get_children(intent_id))
# retry: Union[google.api_core.retry.Retry,
# timeout: Optional[float] = None
i = 0
if intent_id is None and len(global_intent_list) <= 0:
intents_client = dialogflow.IntentsClient()
parent = dialogflow.AgentsClient.agent_path(project_id)
intents = intents_client.list_intents(request={"parent": parent, "intent_view": 'INTENT_VIEW_FULL'})
for intent in intents:
print(i)
i = i + 1
intent_info = self.get_intent_data(intent)
global_intent_list.append(intent_info)
json_response = jsonify(global_intent_list)
return json_response
# return "success"
elif intent_id is None and len(global_intent_list) > 0:
json_response = jsonify(global_intent_list)
return json_response
else:
intents_client = dialogflow.IntentsClient()
intent_name = intents_client.intent_path(project_id, intent_id)
intent = intents_client.get_intent(request={"name": intent_name, "intent_view": 'INTENT_VIEW_FULL'})
# response_dictionary = self.get_intent_data(intent)
return jsonify(self.get_intent_data(intent))
except Exception as e:
print(e)
return str(e)
But when I am seeing the non English language intents, then I can find that if the request is "আমি কি ১০ টাকার অ্যাকাউন্ট খুলতে পারবো", then the response is "\340\246\225\340\247\203\340\246\267\340". How can I decode this response? Please help me.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
