gemini-webapi 1.8.0__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 +26 -15
- gemini_webapi/constants.py +20 -2
- {gemini_webapi-1.8.0.dist-info → gemini_webapi-1.8.2.dist-info}/METADATA +6 -3
- {gemini_webapi-1.8.0.dist-info → gemini_webapi-1.8.2.dist-info}/RECORD +7 -7
- {gemini_webapi-1.8.0.dist-info → gemini_webapi-1.8.2.dist-info}/WHEEL +1 -1
- {gemini_webapi-1.8.0.dist-info → gemini_webapi-1.8.2.dist-info}/LICENSE +0 -0
- {gemini_webapi-1.8.0.dist-info → gemini_webapi-1.8.2.dist-info}/top_level.txt +0 -0
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
|
|
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
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
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(
|
gemini_webapi/constants.py
CHANGED
|
@@ -24,19 +24,37 @@ class Headers(Enum):
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class Model(Enum):
|
|
27
|
-
UNSPECIFIED = ("unspecified", {})
|
|
27
|
+
UNSPECIFIED = ("unspecified", {}, False)
|
|
28
28
|
G_1_5_FLASH = (
|
|
29
29
|
"gemini-1.5-flash",
|
|
30
30
|
{"x-goog-ext-525001261-jspb": '[null,null,null,null,"7daceb7ef88130f5"]'},
|
|
31
|
+
False,
|
|
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,
|
|
31
42
|
)
|
|
32
43
|
G_2_0_FLASH_EXP = (
|
|
33
44
|
"gemini-2.0-flash-exp",
|
|
34
45
|
{"x-goog-ext-525001261-jspb": '[null,null,null,null,"948b866104ccf484"]'},
|
|
46
|
+
False,
|
|
47
|
+
)
|
|
48
|
+
G_2_0_EXP_ADVANCED = (
|
|
49
|
+
"gemini-2.0-exp-advanced",
|
|
50
|
+
{"x-goog-ext-525001261-jspb": '[null,null,null,null,"b1e46a6037e6aa9f"]'},
|
|
51
|
+
True,
|
|
35
52
|
)
|
|
36
53
|
|
|
37
|
-
def __init__(self, name, header):
|
|
54
|
+
def __init__(self, name, header, advanced_only):
|
|
38
55
|
self.model_name = name
|
|
39
56
|
self.model_header = header
|
|
57
|
+
self.advanced_only = advanced_only
|
|
40
58
|
|
|
41
59
|
@classmethod
|
|
42
60
|
def from_name(cls, name: str):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: gemini-webapi
|
|
3
|
-
Version: 1.8.
|
|
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,9 +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
|
|
952
|
+
- `gemini-2.0-exp-advanced` - Gemini 2.0 Experimental Advanced **(requires Gemini Advanced account)**
|
|
950
953
|
|
|
951
954
|
```python
|
|
952
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=
|
|
3
|
-
gemini_webapi/constants.py,sha256=
|
|
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.
|
|
16
|
-
gemini_webapi-1.8.
|
|
17
|
-
gemini_webapi-1.8.
|
|
18
|
-
gemini_webapi-1.8.
|
|
19
|
-
gemini_webapi-1.8.
|
|
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,,
|
|
File without changes
|
|
File without changes
|