gemini-webapi 1.8.1__py3-none-any.whl → 1.8.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gemini_webapi/client.py CHANGED
@@ -381,7 +381,7 @@ class GeminiClient:
381
381
  for i, candidate in enumerate(body[4]):
382
382
  text = candidate[1][0]
383
383
  if re.match(
384
- r"^http://googleusercontent.com/card_content/\d+$", text
384
+ r"^http://googleusercontent\.com/card_content/\d+$", text
385
385
  ):
386
386
  text = candidate[22] and candidate[22][0] or text
387
387
 
@@ -404,20 +404,31 @@ class GeminiClient:
404
404
  if candidate[12] and candidate[12][7] and candidate[12][7][0]:
405
405
  image_generation_body = json.loads(response_json[1][2])
406
406
  image_generation_candidate = image_generation_body[4][i]
407
- generated_images = [
408
- GeneratedImage(
409
- url=image[0][3][3],
410
- title=f"[Generated Image {image[3][6]}]",
411
- alt=len(image[3][5]) > i
412
- and image[3][5][i]
413
- or image[3][5][0],
414
- proxy=self.proxy,
415
- cookies=self.cookies,
416
- )
417
- for i, image in enumerate(
418
- image_generation_candidate[12][7][0]
419
- )
420
- ] or []
407
+ text = re.sub(
408
+ r"http://googleusercontent\.com/image_generation_content/\d+$",
409
+ "",
410
+ image_generation_candidate[1][0],
411
+ ).rstrip()
412
+
413
+ if (
414
+ image_generation_candidate[12]
415
+ and image_generation_candidate[12][7]
416
+ and image_generation_candidate[12][7][0]
417
+ ):
418
+ generated_images = [
419
+ GeneratedImage(
420
+ url=image[0][3][3],
421
+ title=f"[Generated Image {image[3][6]}]",
422
+ alt=len(image[3][5]) > i
423
+ and image[3][5][i]
424
+ or image[3][5][0],
425
+ proxy=self.proxy,
426
+ cookies=self.cookies,
427
+ )
428
+ for i, image in enumerate(
429
+ image_generation_candidate[12][7][0]
430
+ )
431
+ ]
421
432
 
422
433
  candidates.append(
423
434
  Candidate(
@@ -30,6 +30,16 @@ class Model(Enum):
30
30
  {"x-goog-ext-525001261-jspb": '[null,null,null,null,"7daceb7ef88130f5"]'},
31
31
  False,
32
32
  )
33
+ G_1_5_PRO = (
34
+ "gemini-1.5-pro",
35
+ {"x-goog-ext-525001261-jspb": '[null,null,null,null,"9d60dfae93c9ff1f"]'},
36
+ True,
37
+ )
38
+ G_1_5_PRO_RESEARCH = (
39
+ "gemini-1.5-pro-research",
40
+ {"x-goog-ext-525001261-jspb": '[null,null,null,null,"e5a44cb1dae2b489"]'},
41
+ True,
42
+ )
33
43
  G_2_0_FLASH_EXP = (
34
44
  "gemini-2.0-flash-exp",
35
45
  {"x-goog-ext-525001261-jspb": '[null,null,null,null,"948b866104ccf484"]'},
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: gemini-webapi
3
- Version: 1.8.1
3
+ Version: 1.8.2
4
4
  Summary: ✨ An elegant async Python wrapper for Google Gemini web app
5
5
  Author: UZQueen
6
6
  License: GNU AFFERO GENERAL PUBLIC LICENSE
@@ -944,10 +944,12 @@ You can choose a specified language model version by passing `model` argument to
944
944
 
945
945
  Currently available models (as of Dec 21, 2024):
946
946
 
947
- - `unspecified` - Default model (Gemini 1.5 Flash)
947
+ - `unspecified` - Default model (Gemini 1.5 Pro if account has Gemini Advanced subscription, otherwise Gemini 1.5 Flash)
948
948
  - `gemini-1.5-flash` - Gemini 1.5 Flash
949
+ - `gemini-1.5-pro` - Gemini 1.5 Pro **(requires Gemini Advanced account)**
950
+ - `gemini-1.5-pro-research` - Gemini 1.5 Pro with Deep Research **(requires Gemini Advanced account)**
949
951
  - `gemini-2.0-flash-exp` - Gemini 2.0 Flash Experimental
950
- - `gemini-2.0-exp-advanced` - Gemini 2.0 Experimental Advanced (requires Gemini Advanced account)
952
+ - `gemini-2.0-exp-advanced` - Gemini 2.0 Experimental Advanced **(requires Gemini Advanced account)**
951
953
 
952
954
  ```python
953
955
  from gemini_webapi.constants import Model
@@ -1,6 +1,6 @@
1
1
  gemini_webapi/__init__.py,sha256=28uNIywK4vCXxENaSagNWUzhqr1RyNtLzDF6WRRM4KQ,194
2
- gemini_webapi/client.py,sha256=SZEihRytBcBNa8ZJllEU3xFRB1cX8ZrEY_3TRjDdN4g,22169
3
- gemini_webapi/constants.py,sha256=43tV363_lv6J-idZ48n0_G-A4GZSwIW0gJ60GibNMa0,1866
2
+ gemini_webapi/client.py,sha256=sw95MQu5hozKSCI4_bzzRgnyBKUPTHnnOOUtRY7sg5M,22731
3
+ gemini_webapi/constants.py,sha256=xwWz2epimU_njyBe8yy-zCT69-TKn5RdPJxMn3pAqzQ,2178
4
4
  gemini_webapi/exceptions.py,sha256=6e-EXHGApi4iC0GDw7RKc3YqVK8UvEkHYaJyGQbReLw,548
5
5
  gemini_webapi/types/__init__.py,sha256=d2kvXnE004s2E2KDmPPLi5N-BQ59FgDSlrGrO3Wphww,163
6
6
  gemini_webapi/types/candidate.py,sha256=Z9bpIK4l8UWbUVMLEoophfhgROo93dxOM9cAwx77CkU,1030
@@ -12,8 +12,8 @@ gemini_webapi/utils/load_browser_cookies.py,sha256=A5n_VsB7Rm8ck5lpy856UNJEhv30l
12
12
  gemini_webapi/utils/logger.py,sha256=PF4ROQq7scRRrWzeYdeYiYs2S2Jqr0bgjyrPbXVOCqE,816
13
13
  gemini_webapi/utils/rotate_1psidts.py,sha256=cwCXsE_mX2knaKCuquZT2jsRXHQo-GK2Ldom-cO9Gio,1668
14
14
  gemini_webapi/utils/upload_file.py,sha256=X0k-3jW7usheFo5z0nXL9mUt-XF-2L2OgwpJnPSIcKw,1151
15
- gemini_webapi-1.8.1.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
16
- gemini_webapi-1.8.1.dist-info/METADATA,sha256=cV33fx9JrgMZJQjiIe5sLUZYkobSIyzW5pmK8mCRBuw,56893
17
- gemini_webapi-1.8.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
- gemini_webapi-1.8.1.dist-info/top_level.txt,sha256=dtWtug_ZrmnUqCYuu8NmGzTgWglHeNzhHU_hXmqZGWE,14
19
- gemini_webapi-1.8.1.dist-info/RECORD,,
15
+ gemini_webapi-1.8.2.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
16
+ gemini_webapi-1.8.2.dist-info/METADATA,sha256=F-t_Ea1rhbotXoCzXp2BlCZZQ8__7kej6zuVI6DI_hc,57145
17
+ gemini_webapi-1.8.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
+ gemini_webapi-1.8.2.dist-info/top_level.txt,sha256=dtWtug_ZrmnUqCYuu8NmGzTgWglHeNzhHU_hXmqZGWE,14
19
+ gemini_webapi-1.8.2.dist-info/RECORD,,