优化处理

pull/1251/head
foxplaying 2025-09-22 12:28:06 +08:00 committed by GitHub
parent 45115b802f
commit be5b1cd1f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -350,9 +350,9 @@ class GeminiClient(BaseClient):
http_options_kwargs = {"timeout": api_provider.timeout}
# 增加传入参数处理
if api_provider.base_url:
parts = api_provider.base_url.rsplit("/", 1)
parts = api_provider.base_url.rstrip("/").rsplit("/", 1)
if len(parts) == 2 and parts[1].startswith("v"):
http_options_kwargs["base_url"] = parts[0] + "/"
http_options_kwargs["base_url"] = f"{parts[0]}/"
http_options_kwargs["api_version"] = parts[1]
else:
http_options_kwargs["base_url"] = api_provider.base_url