diff --git a/README.md b/README.md index 19ba4cc..ab2bf7d 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,7 @@ Currently available models (as of Dec 21, 2024): - `unspecified` - Default model (Gemini 1.5 Flash) - `gemini-1.5-flash` - Gemini 1.5 Flash - `gemini-2.0-flash-exp` - Gemini 2.0 Flash Experimental +- `gemini-2.0-exp-advanced` - Gemini 2.0 Experimental Advanced (requires Gemini Advanced account) ```python from gemini_webapi.constants import Model diff --git a/src/gemini_webapi/constants.py b/src/gemini_webapi/constants.py index 5a16e4a..2be178d 100644 --- a/src/gemini_webapi/constants.py +++ b/src/gemini_webapi/constants.py @@ -24,19 +24,27 @@ class Headers(Enum): class Model(Enum): - UNSPECIFIED = ("unspecified", {}) + UNSPECIFIED = ("unspecified", {}, False) G_1_5_FLASH = ( "gemini-1.5-flash", {"x-goog-ext-525001261-jspb": '[null,null,null,null,"7daceb7ef88130f5"]'}, + False, ) G_2_0_FLASH_EXP = ( "gemini-2.0-flash-exp", {"x-goog-ext-525001261-jspb": '[null,null,null,null,"948b866104ccf484"]'}, + False, + ) + G_2_0_EXP_ADVANCED = ( + "gemini-2.0-exp-advanced", + {"x-goog-ext-525001261-jspb": '[null,null,null,null,"b1e46a6037e6aa9f"]'}, + True, ) - def __init__(self, name, header): + def __init__(self, name, header, advanced_only): self.model_name = name self.model_header = header + self.advanced_only = advanced_only @classmethod def from_name(cls, name: str): diff --git a/tests/test_client_features.py b/tests/test_client_features.py index 05c5f38..5f33b59 100644 --- a/tests/test_client_features.py +++ b/tests/test_client_features.py @@ -31,6 +31,10 @@ async def test_successful_request(self): @logger.catch(reraise=True) async def test_switch_model(self): for model in Model: + if model.advanced_only: + logger.debug(f"Model {model.model_name} requires an advanced account") + continue + response = await self.geminiclient.generate_content( "What's you language model version? Reply version number only.", model=model,