Skip to content

Commit

Permalink
added lang code
Browse files Browse the repository at this point in the history
  • Loading branch information
pavi committed Jul 26, 2024
1 parent 3a71acc commit 3a54fdf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions geminikit/asynic_gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ async def share(self, response_id, conversation_id, choice_id,**args):
async def cookies(self):
return self.client.cookies.jar

async def speech(self, text):
async def speech(self, text,**args):
lang_code = args.get("lang_code") or "en-GB"
bott = self.bott
SNlM0e = self.SNlM0e
uid = int("1" + str(random.randint(0, 999999)).zfill(6))
Expand All @@ -233,7 +234,7 @@ async def speech(self, text):
"rt": "c",
}

input_text_struct = [[["XqA3Ic", json.dumps([None, text, 'en-GB', None, 2])]], ["generic"]]
input_text_struct = [[["XqA3Ic", json.dumps([None, text, lang_code, None, 2])]], ["generic"]]

data = {
"f.req": json.dumps(input_text_struct),
Expand Down
5 changes: 3 additions & 2 deletions geminikit/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ def share(self, conversation_id, response_id, choice_id, req_id, fsid,**args):
def cookies(self):
return self.client.cookies.jar

def speech(self, text):
def speech(self, text,**args):
lang_code = args.get("lang_code") or "en-GB"
bott = self.bott
SNlM0e = self.SNlM0e
uid = int("1" + str(random.randint(0, 999999)).zfill(6))
Expand All @@ -232,7 +233,7 @@ def speech(self, text):
"rt": "c",
}

input_text_struct = [[["XqA3Ic", json.dumps([None, text, 'en-GB', None, 2])]], ["generic"]]
input_text_struct = [[["XqA3Ic", json.dumps([None, text, lang_code, None, 2])]], ["generic"]]

data = {
"f.req": json.dumps(input_text_struct),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def get_long_description():
#
setup(
name="geminikit",
version="1.1.5",
version="1.1.6",
author="paviththanan",
author_email="[email protected]",
description="The python package that returns Response of Google Gemini through Cookies.",
Expand Down

0 comments on commit 3a54fdf

Please sign in to comment.