diff --git a/backend/app/core/providers.py b/backend/app/core/providers.py index 63a98c102..743ee1883 100644 --- a/backend/app/core/providers.py +++ b/backend/app/core/providers.py @@ -52,12 +52,8 @@ class ProviderConfig: Provider.GOOGLE: ProviderConfig( required_fields=[ "api_key", - "project_id", - "location", - "sa_key", - "gcs_bucket", ], - sensitive_fields=["api_key", "sa_key"], + sensitive_fields=["api_key"], ), Provider.WEBHOOK_SECRET: ProviderConfig( required_fields=["webhook_secret"], sensitive_fields=["webhook_secret"] diff --git a/backend/app/services/llm/mappers.py b/backend/app/services/llm/mappers.py index ab6d70fe4..7e8f04624 100644 --- a/backend/app/services/llm/mappers.py +++ b/backend/app/services/llm/mappers.py @@ -592,11 +592,6 @@ def transform_kaapi_config_to_native( ) if kaapi_config.provider == Provider.GOOGLE: - if kaapi_config.type not in (CompletionType.STT, CompletionType.TTS): - raise ValueError( - f"google provider does not support completion type '{kaapi_config.type}'. " - "Use the 'google-aistudio' provider for text completions." - ) # Kaapi STT/TTS param shape is identical to Google's; reuse the Google mapper. mapped_params, warnings = map_kaapi_to_google_params( kaapi_config.params, kaapi_config.type diff --git a/backend/app/tests/services/llm/test_mappers.py b/backend/app/tests/services/llm/test_mappers.py index db3d9ec37..51f2484a4 100644 --- a/backend/app/tests/services/llm/test_mappers.py +++ b/backend/app/tests/services/llm/test_mappers.py @@ -887,25 +887,23 @@ def test_temperature_zero_is_preserved(self): class TestTransformGoogleVertexRouting: """Routing contract for the ``google`` provider (which executes via - Vertex AI). Text completions are explicitly rejected — they must go - through the ``google-aistudio`` provider.""" + Vertex AI).""" - def test_text_completion_is_rejected(self, db: Session): - """``google`` is audio-only (Vertex STT/TTS) — text completions - must be routed through ``google-aistudio``.""" + def test_text_completion_maps_via_google_mapper(self, db: Session): + """``google`` text completions reuse the Google mapper and produce a + ``google-native`` config (param shape is identical to Google's).""" kaapi_config = KaapiCompletionConfig( provider="google", type="text", params={"model": "gemini-2.5-pro"}, ) - with pytest.raises(ValueError) as exc_info: - transform_kaapi_config_to_native(session=db, kaapi_config=kaapi_config) + native_config, warnings = transform_kaapi_config_to_native( + session=db, kaapi_config=kaapi_config + ) - msg = str(exc_info.value) - assert "google" in msg - assert "text" in msg - assert "google-aistudio" in msg # hints the caller toward the right provider + assert native_config.provider == "google-native" + assert native_config.params["model"] == "gemini-2.5-pro" def test_unsupported_language_emits_warning(self, db: Session): """Languages not in BCP47_LOCALE_TO_GEMINI_LANG fall back to auto-detect