gemini-webapi 1.12.0__py3-none-any.whl → 1.12.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
@@ -313,7 +313,7 @@ class GeminiClient:
313
313
  If prompt is empty.
314
314
  `gemini_webapi.TimeoutError`
315
315
  If request timed out.
316
- `gemini_webapi.GenimiError`
316
+ `gemini_webapi.GeminiError`
317
317
  If no reply candidate found in response.
318
318
  `gemini_webapi.APIError`
319
319
  - If request failed with status code other than 200.
@@ -630,7 +630,7 @@ class ChatSession:
630
630
  If prompt is empty.
631
631
  `gemini_webapi.TimeoutError`
632
632
  If request timed out.
633
- `gemini_webapi.GenimiError`
633
+ `gemini_webapi.GeminiError`
634
634
  If no reply candidate found in response.
635
635
  `gemini_webapi.APIError`
636
636
  - If request failed with status code other than 200.
@@ -25,19 +25,9 @@ class Headers(Enum):
25
25
 
26
26
  class Model(Enum):
27
27
  UNSPECIFIED = ("unspecified", {}, False)
28
- G_2_0_FLASH = (
29
- "gemini-2.0-flash",
30
- {"x-goog-ext-525001261-jspb": '[1,null,null,null,"f299729663a2343f"]'},
31
- False,
32
- )
33
- G_2_0_FLASH_THINKING = (
34
- "gemini-2.0-flash-thinking",
35
- {"x-goog-ext-525001261-jspb": '[null,null,null,null,"7ca48d02d802f20a"]'},
36
- False,
37
- ) # Deprecated
38
28
  G_2_5_FLASH = (
39
29
  "gemini-2.5-flash",
40
- {"x-goog-ext-525001261-jspb": '[1,null,null,null,"35609594dbe934d8"]'},
30
+ {"x-goog-ext-525001261-jspb": '[1,null,null,null,"9ec249fc9ad08861"]'},
41
31
  False,
42
32
  )
43
33
  G_2_5_PRO = (
@@ -45,6 +35,16 @@ class Model(Enum):
45
35
  {"x-goog-ext-525001261-jspb": '[1,null,null,null,"2525e3954d185b3c"]'},
46
36
  False,
47
37
  )
38
+ G_2_0_FLASH = (
39
+ "gemini-2.0-flash",
40
+ {"x-goog-ext-525001261-jspb": '[1,null,null,null,"f299729663a2343f"]'},
41
+ False,
42
+ ) # Deprecated
43
+ G_2_0_FLASH_THINKING = (
44
+ "gemini-2.0-flash-thinking",
45
+ {"x-goog-ext-525001261-jspb": '[null,null,null,null,"7ca48d02d802f20a"]'},
46
+ False,
47
+ ) # Deprecated
48
48
  G_2_0_EXP_ADVANCED = (
49
49
  "gemini-2.0-exp-advanced",
50
50
  {"x-goog-ext-525001261-jspb": '[null,null,null,null,"b1e46a6037e6aa9f"]'},
@@ -1,4 +1,5 @@
1
- from pydantic import BaseModel
1
+ import html
2
+ from pydantic import BaseModel, field_validator
2
3
 
3
4
  from .image import Image, WebImage, GeneratedImage
4
5
 
@@ -33,6 +34,17 @@ class Candidate(BaseModel):
33
34
  def __repr__(self):
34
35
  return f"Candidate(rcid='{self.rcid}', text='{len(self.text) <= 20 and self.text or self.text[:20] + '...'}', images={self.images})"
35
36
 
37
+ @field_validator("text", "thoughts")
38
+ @classmethod
39
+ def decode_html(cls, value: str) -> str:
40
+ """
41
+ Auto unescape HTML entities in text/thoughts if any.
42
+ """
43
+
44
+ if value:
45
+ value = html.unescape(value)
46
+ return value
47
+
36
48
  @property
37
49
  def images(self) -> list[Image]:
38
50
  return self.web_images + self.generated_images
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gemini-webapi
3
- Version: 1.12.0
3
+ Version: 1.12.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
@@ -1,9 +1,9 @@
1
1
  gemini_webapi/__init__.py,sha256=28uNIywK4vCXxENaSagNWUzhqr1RyNtLzDF6WRRM4KQ,194
2
- gemini_webapi/client.py,sha256=sxzFXfi4OGn2yLuPywVLyWo40LcHNdSWL3YXivTaJ1o,25398
3
- gemini_webapi/constants.py,sha256=xQloL6yHngniVEX5UnrsEKGTmMAieqxH7UUceefUVd8,2530
2
+ gemini_webapi/client.py,sha256=W4t4z9Q8tBiS7URdVKFytyELzQylV-K_82NsSqkvrgU,25398
3
+ gemini_webapi/constants.py,sha256=2LBGgrHQk_--iTAzwkk1Qu_3AnuZBUrVjPyNIt51D54,2544
4
4
  gemini_webapi/exceptions.py,sha256=qkXrIpr0L7LtGbq3VcTO8D1xZ50pJtt0dDRp5I3uDSg,1038
5
5
  gemini_webapi/types/__init__.py,sha256=d2kvXnE004s2E2KDmPPLi5N-BQ59FgDSlrGrO3Wphww,163
6
- gemini_webapi/types/candidate.py,sha256=dMoGr53WR7FYDRrXpG9Yd_n9YTHGwGaFHZ8zPt8RMWw,1178
6
+ gemini_webapi/types/candidate.py,sha256=67BhY75toE5mVuB21cmHcTFtw332V_KmCjr3-9VTbJo,1477
7
7
  gemini_webapi/types/image.py,sha256=4BC8hxAWJrYFwzA60CivF1di4RZkzPKjcaSPPFKmRdY,5237
8
8
  gemini_webapi/types/modeloutput.py,sha256=h07kQOkL5r-oPLvZ59uVtO1eP4FGy5ZpzuYQzAeQdr8,1196
9
9
  gemini_webapi/utils/__init__.py,sha256=tO6Sx-3fcPeyITZcvUmcFKBFlR5XW87xUFbNrIh3_mE,374
@@ -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=NyQ9OYPLBOcvpc8bodvEYDIVFrsYN0kdfc831lPEctM,1680
14
14
  gemini_webapi/utils/upload_file.py,sha256=SJOMr6kryK_ClrKmqI96fqZBNFOMPsyAvFINAGAU3rk,1468
15
- gemini_webapi-1.12.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
16
- gemini_webapi-1.12.0.dist-info/METADATA,sha256=lCgrSQ-CJuWI6yyHaYE5JKJtyfbCTLzSDqOgPBIDYdM,57167
17
- gemini_webapi-1.12.0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
18
- gemini_webapi-1.12.0.dist-info/top_level.txt,sha256=dtWtug_ZrmnUqCYuu8NmGzTgWglHeNzhHU_hXmqZGWE,14
19
- gemini_webapi-1.12.0.dist-info/RECORD,,
15
+ gemini_webapi-1.12.2.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
16
+ gemini_webapi-1.12.2.dist-info/METADATA,sha256=BIE34Zty03wSnkrc_uGumvjaP_8P4K_sD3M-q9YeOwg,57167
17
+ gemini_webapi-1.12.2.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
18
+ gemini_webapi-1.12.2.dist-info/top_level.txt,sha256=dtWtug_ZrmnUqCYuu8NmGzTgWglHeNzhHU_hXmqZGWE,14
19
+ gemini_webapi-1.12.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5