add check for logging gigachat response, add sensitive keys for removing from data

This commit is contained in:
KnyazSh 2026-04-17 12:13:54 +03:00
parent eff086d8e0
commit 120f51a39d
2 changed files with 5 additions and 1 deletions

View file

@ -80,6 +80,10 @@ class GigaChatPassthroughConfig(BasePassthroughConfig):
from litellm.types.utils import LlmProviders, ModelResponse
from litellm.utils import ProviderConfigManager
# cost tracking only for completions
if "completions" not in endpoint:
return None
provider_chat_config = ProviderConfigManager.get_provider_chat_config(
provider=LlmProviders(custom_llm_provider),
model=model,

View file

@ -2573,7 +2573,7 @@ async def handle_gigachat_passthrough_router_model(
data["custom_llm_provider"] = "gigachat"
# Remove sensitive keys from data
keys = ["gigachat_auth_url", "gigachat_access_token", "gigachat_scope"]
keys = ["gigachat_auth_url", "gigachat_access_token", "gigachat_scope", "api_base", "api_key"]
for key in keys:
data.pop(key, None)