Skip to content

Commit

Permalink
fix: composition method call
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed May 22, 2023
1 parent 35dfdd9 commit 286a4b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bardapi/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 = {
Expand Down

0 comments on commit 286a4b5

Please sign in to comment.