Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
chore: style black
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed Jul 30, 2023
1 parent 65d7490 commit d872a92
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bardapi/core_cookies.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def get_answer(self, input_text: str) -> dict:
pass

return bard_answer

def speech(self, input_text: str, lang="en-US") -> dict:
"""
Get speech audio from Bard API for the given input text.
Expand All @@ -194,7 +194,9 @@ def speech(self, input_text: str, lang="en-US") -> dict:
"rt": "c",
}

input_text_struct = [[["XqA3Ic", json.dumps([None, input_text, lang, None, 2])]]]
input_text_struct = [
[["XqA3Ic", json.dumps([None, input_text, lang, None, 2])]]
]

data = {
"f.req": json.dumps(input_text_struct),
Expand All @@ -215,8 +217,8 @@ def speech(self, input_text: str, lang="en-US") -> dict:
if not resp_dict:
return {
"content": f"Response Error: {resp.content}. "
f"\nTemporarily unavailable due to traffic or an error in cookie values. "
f"Please double-check the cookie values and verify your network environment."
f"\nTemporarily unavailable due to traffic or an error in cookie values. "
f"Please double-check the cookie values and verify your network environment."
}
resp_json = json.loads(resp_dict)
audio_b64 = resp_json[0]
Expand Down

0 comments on commit d872a92

Please sign in to comment.