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 = {