gemini-webapi 1.15.1__tar.gz → 1.15.2__tar.gz

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.
Files changed (42) hide show
  1. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/PKG-INFO +1 -1
  2. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/client.py +6 -1
  3. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/constants.py +1 -0
  4. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi.egg-info/PKG-INFO +1 -1
  5. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/tests/test_client_features.py +2 -2
  6. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/tests/test_gem_mixin.py +3 -3
  7. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/.github/dependabot.yml +0 -0
  8. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/.github/workflows/github-release.yml +0 -0
  9. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/.github/workflows/pypi-publish.yml +0 -0
  10. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/.gitignore +0 -0
  11. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/.vscode/launch.json +0 -0
  12. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/.vscode/settings.json +0 -0
  13. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/LICENSE +0 -0
  14. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/README.md +0 -0
  15. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/assets/banner.png +0 -0
  16. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/assets/favicon.png +0 -0
  17. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/assets/logo.svg +0 -0
  18. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/assets/sample.pdf +0 -0
  19. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/pyproject.toml +0 -0
  20. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/setup.cfg +0 -0
  21. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/__init__.py +0 -0
  22. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/components/__init__.py +0 -0
  23. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/components/gem_mixin.py +0 -0
  24. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/exceptions.py +0 -0
  25. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/types/__init__.py +0 -0
  26. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/types/candidate.py +0 -0
  27. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/types/gem.py +0 -0
  28. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/types/grpc.py +0 -0
  29. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/types/image.py +0 -0
  30. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/types/modeloutput.py +0 -0
  31. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/utils/__init__.py +0 -0
  32. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/utils/decorators.py +0 -0
  33. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/utils/get_access_token.py +0 -0
  34. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/utils/load_browser_cookies.py +0 -0
  35. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/utils/logger.py +0 -0
  36. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/utils/rotate_1psidts.py +0 -0
  37. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi/utils/upload_file.py +0 -0
  38. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi.egg-info/SOURCES.txt +0 -0
  39. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi.egg-info/dependency_links.txt +0 -0
  40. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi.egg-info/requires.txt +0 -0
  41. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/src/gemini_webapi.egg-info/top_level.txt +0 -0
  42. {gemini_webapi-1.15.1 → gemini_webapi-1.15.2}/tests/test_save_image.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gemini-webapi
3
- Version: 1.15.1
3
+ Version: 1.15.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
@@ -118,7 +118,7 @@ class GeminiClient(GemMixin):
118
118
 
119
119
  async def init(
120
120
  self,
121
- timeout: float = 30,
121
+ timeout: float = 300,
122
122
  auto_close: bool = False,
123
123
  close_delay: float = 300,
124
124
  auto_refresh: bool = True,
@@ -371,6 +371,11 @@ class GeminiClient(GemMixin):
371
371
  raise UsageLimitExceeded(
372
372
  f"Failed to generate contents. Usage limit of {model.model_name} model has exceeded. Please try switching to another model."
373
373
  )
374
+ case ErrorCode.MODEL_INCONSISTENT:
375
+ raise ModelInvalid(
376
+ "Failed to generate contents. The specified model is inconsistent with the chat history. Please make sure to pass the same "
377
+ "`model` parameter when starting a chat session with previous metadata."
378
+ )
374
379
  case ErrorCode.MODEL_HEADER_INVALID:
375
380
  raise ModelInvalid(
376
381
  "Failed to generate contents. The specified model is not available. Please update gemini_webapi to the latest version. "
@@ -84,5 +84,6 @@ class ErrorCode(IntEnum):
84
84
  """
85
85
 
86
86
  USAGE_LIMIT_EXCEEDED = 1037
87
+ MODEL_INCONSISTENT = 1050
87
88
  MODEL_HEADER_INVALID = 1052
88
89
  IP_TEMPORARILY_BLOCKED = 1060
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gemini-webapi
3
- Version: 1.15.1
3
+ Version: 1.15.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
@@ -18,7 +18,7 @@ class TestGeminiClient(unittest.IsolatedAsyncioTestCase):
18
18
  )
19
19
 
20
20
  try:
21
- await self.geminiclient.init(timeout=60, auto_refresh=False)
21
+ await self.geminiclient.init(auto_refresh=False)
22
22
  except AuthError as e:
23
23
  self.skipTest(e)
24
24
 
@@ -98,7 +98,7 @@ class TestGeminiClient(unittest.IsolatedAsyncioTestCase):
98
98
  @logger.catch(reraise=True)
99
99
  async def test_generation_with_gem(self):
100
100
  response = await self.geminiclient.generate_content(
101
- "what's your system prompt?",
101
+ "What's your system prompt?",
102
102
  model=Model.G_2_5_FLASH,
103
103
  gem=Gem(id="coding-partner", name="Coding partner", predefined=True),
104
104
  )
@@ -17,17 +17,17 @@ class TestGemMixin(unittest.IsolatedAsyncioTestCase):
17
17
  )
18
18
 
19
19
  try:
20
- await self.geminiclient.init(timeout=60, auto_refresh=False)
20
+ await self.geminiclient.init(auto_refresh=False)
21
21
  except AuthError as e:
22
22
  self.skipTest(e)
23
23
 
24
24
  @logger.catch(reraise=True)
25
25
  async def test_fetch_gems(self):
26
- await self.geminiclient.fetch_gems(include_hidden=True)
26
+ await self.geminiclient.fetch_gems(include_hidden=False)
27
27
  gems = self.geminiclient.gems
28
28
  self.assertTrue(len(gems.filter(predefined=True)) > 0)
29
29
  for gem in gems:
30
- logger.debug(gem.name)
30
+ logger.debug(gem)
31
31
 
32
32
  custom_gems = gems.filter(predefined=False)
33
33
  if custom_gems:
File without changes
File without changes
File without changes