mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-25 08:48:13 +02:00
fix: remove gemini 2.0 flash from supported models
This commit is contained in:
parent
ca598933ef
commit
1e5e556a4d
6 changed files with 22 additions and 11 deletions
|
|
@ -1,6 +1,4 @@
|
|||
GOOGLE_MODELS = (
|
||||
"gemini-2.0-flash",
|
||||
"gemini-2.0-flash-lite",
|
||||
"gemini-2.5-flash",
|
||||
"gemini-2.5-flash-lite",
|
||||
"gemini-3.5-flash",
|
||||
|
|
|
|||
|
|
@ -316,7 +316,6 @@ OPENROUTER_MODELS = [
|
|||
"openai/gpt-4.1-mini",
|
||||
"anthropic/claude-sonnet-4",
|
||||
"google/gemini-2.5-flash",
|
||||
"google/gemini-2.0-flash",
|
||||
"meta-llama/llama-3.3-70b-instruct",
|
||||
"deepseek/deepseek-chat-v3-0324",
|
||||
]
|
||||
|
|
@ -351,7 +350,7 @@ class GoogleLLMService(BaseLLMConfiguration):
|
|||
model_config = GOOGLE_PROVIDER_MODEL_CONFIG
|
||||
provider: Literal[ServiceProviders.GOOGLE] = ServiceProviders.GOOGLE
|
||||
model: str = Field(
|
||||
default="gemini-2.0-flash",
|
||||
default="gemini-2.5-flash",
|
||||
description="Gemini model on Google AI Studio (not Vertex).",
|
||||
json_schema_extra={"examples": GOOGLE_MODELS, "allow_custom_input": True},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -719,6 +719,19 @@ def create_tts_service(
|
|||
)
|
||||
|
||||
|
||||
def _migrate_deprecated_google_model(model: str) -> str:
|
||||
"""Google removed the ``gemini-2.0-flash*`` models. Transparently upgrade
|
||||
any stored config that still references them to the 2.5 equivalent so old
|
||||
user configurations keep working instead of failing at runtime."""
|
||||
if model and model.startswith("gemini-2.0-flash"):
|
||||
migrated = model.replace("gemini-2.0-", "gemini-2.5-", 1)
|
||||
logger.warning(
|
||||
f"Google model '{model}' is no longer supported; using '{migrated}' instead"
|
||||
)
|
||||
return migrated
|
||||
return model
|
||||
|
||||
|
||||
def create_llm_service_from_provider(
|
||||
provider: str,
|
||||
model: str,
|
||||
|
|
@ -776,6 +789,7 @@ def create_llm_service_from_provider(
|
|||
**kwargs,
|
||||
)
|
||||
elif provider == ServiceProviders.GOOGLE.value:
|
||||
model = _migrate_deprecated_google_model(model)
|
||||
return GoogleLLMService(
|
||||
api_key=api_key,
|
||||
settings=GoogleLLMSettings(model=model, temperature=0.1),
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ async def test_byok_realtime_validator_does_not_require_stt_or_tts():
|
|||
"llm": {
|
||||
"provider": "google",
|
||||
"api_key": "google-llm-key",
|
||||
"model": "gemini-2.0-flash",
|
||||
"model": "gemini-2.5-flash",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -154,7 +154,7 @@ async def test_pipeline_validator_requires_stt_and_tts_when_not_realtime():
|
|||
llm=GoogleLLMService(
|
||||
provider="google",
|
||||
api_key="google-llm-key",
|
||||
model="gemini-2.0-flash",
|
||||
model="gemini-2.5-flash",
|
||||
),
|
||||
realtime=GoogleRealtimeLLMConfiguration(
|
||||
provider="google_realtime",
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class TestMaskedKeyRejection:
|
|||
"llm": {
|
||||
"provider": "google",
|
||||
"api_key": MASKED_KEY,
|
||||
"model": "gemini-2.0-flash",
|
||||
"model": "gemini-2.5-flash",
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
@ -97,7 +97,7 @@ class TestMaskedKeyRejection:
|
|||
"llm": {
|
||||
"provider": "google",
|
||||
"api_key": ["AIzaSyRealKey123456", MASKED_KEY],
|
||||
"model": "gemini-2.0-flash",
|
||||
"model": "gemini-2.5-flash",
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
@ -115,7 +115,7 @@ class TestMaskedKeyRejection:
|
|||
llm=GoogleLLMService(
|
||||
provider="google",
|
||||
api_key=new_key,
|
||||
model="gemini-2.0-flash",
|
||||
model="gemini-2.5-flash",
|
||||
)
|
||||
)
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ class TestMaskedKeyRejection:
|
|||
"llm": {
|
||||
"provider": "google",
|
||||
"api_key": new_key,
|
||||
"model": "gemini-2.0-flash",
|
||||
"model": "gemini-2.5-flash",
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue