mirror of
https://github.com/langgenius/dify.git
synced 2026-06-09 09:31:52 +08:00
97bb338e7d
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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"
|