From 286a4b5b5a3a02ba0aca5c9c4dbc7a86c797dce9 Mon Sep 17 00:00:00 2001 From: parkminwoo Date: Mon, 22 May 2023 14:58:20 +0900 Subject: [PATCH] fix: composition method call --- bardapi/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bardapi/core.py b/bardapi/core.py index 0a76aa906..ab9c31eed 100644 --- a/bardapi/core.py +++ b/bardapi/core.py @@ -83,7 +83,7 @@ def get_answer(self, input_text: str) -> dict: "rt": "c", } if self.language is not None or self.language not in ALLOWED_LANGUAGES: - self.translator(input_text, dest="en") + self.translator.translate(input_text, dest="en") input_text_struct = [ [input_text], None, @@ -106,9 +106,9 @@ def get_answer(self, input_text: str) -> dict: return {"content": f"Response Error: {resp.content}."} parsed_answer = json.loads(resp_dict) if self.language is not None or self.language not in ALLOWED_LANGUAGES: - parsed_answer[0][0] = self.translator(parsed_answer[0][0], self.language) + parsed_answer[0][0] = self.translator.translate(parsed_answer[0][0], self.language) parsed_answer[4] = [ - (x[0], self.translator(x[1][0], self.language)) for x in parsed_answer[4] + (x[0], self.translator.translate(x[1][0], self.language)) for x in parsed_answer[4] ] print(parsed_answer[4]) bard_answer = {