From 3a54fdf5a1f1c039bce4cf093a8155b453fd2346 Mon Sep 17 00:00:00 2001 From: pavi Date: Fri, 26 Jul 2024 09:07:51 +0530 Subject: [PATCH] added lang code --- geminikit/asynic_gemini.py | 5 +++-- geminikit/gemini.py | 5 +++-- setup.py | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/geminikit/asynic_gemini.py b/geminikit/asynic_gemini.py index 17c0277..23c26e3 100644 --- a/geminikit/asynic_gemini.py +++ b/geminikit/asynic_gemini.py @@ -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)) @@ -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), diff --git a/geminikit/gemini.py b/geminikit/gemini.py index d8fc9c9..5f72028 100644 --- a/geminikit/gemini.py +++ b/geminikit/gemini.py @@ -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)) @@ -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), diff --git a/setup.py b/setup.py index 8515e7c..bd59cc0 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ def get_long_description(): # setup( name="geminikit", - version="1.1.5", + version="1.1.6", author="paviththanan", author_email="rkpavi06@gmail.com", description="The python package that returns Response of Google Gemini through Cookies.",