Skip to content

Commit effccc6

Browse files
author
moon
committed
Append Open API url postfix to endpoint_url
1 parent ce5d84d commit effccc6

File tree

1 file changed

+2
-0
lines changed
  • api/core/model_runtime/model_providers/openai_api_compatible/llm

1 file changed

+2
-0
lines changed

api/core/model_runtime/model_providers/openai_api_compatible/llm/llm.py

+2
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ def validate_credentials(self, model: str, credentials: dict) -> None:
120120
endpoint_url = credentials["endpoint_url"]
121121
if not endpoint_url.endswith("/"):
122122
endpoint_url += "/"
123+
if not endpoint_url.endswith("v1/"):
124+
endpoint_url += "v1/"
123125

124126
# prepare the payload for a simple ping to the model
125127
data = {"model": model, "max_tokens": 5}

0 commit comments

Comments
 (0)