mirror of
https://mirror.skon.top/github.com/langgenius/dify.git
synced 2026-04-20 23:40:16 +08:00
4 lines
207 B
Python
4 lines
207 B
Python
def normalize_api_base_url(base_url: str) -> str:
|
|
"""Normalize a base URL to always end with /v1, avoiding double /v1 suffixes."""
|
|
return base_url.rstrip("/").removesuffix("/v1").rstrip("/") + "/v1"
|