Skip to content

Commit ffe343d

Browse files
committed
fix: update upload policy URL based on API base configuration
1 parent 182c9e2 commit ffe343d

File tree

1 file changed

+5
-1
lines changed
  • apps/models_provider/impl/aliyun_bai_lian_model_provider/model

1 file changed

+5
-1
lines changed

apps/models_provider/impl/aliyun_bai_lian_model_provider/model/image.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ def new_instance(model_type, model_name, model_credential: Dict[str, object], **
3636
return chat_tong_yi
3737

3838
def check_auth(self, api_key):
39-
return True
39+
return True
4040

4141
def get_upload_policy(self, api_key, model_name):
4242
"""获取文件上传凭证"""
4343
url = "https://dashscope.aliyuncs.com/api/v1/uploads"
44+
if 'dashscope-us' in self.openai_api_base:
45+
url = "https://dashscope-us.aliyuncs.com/api/v1/uploads"
46+
elif 'dashscope-intl' in self.openai_api_base:
47+
url = "https://dashscope-intl.aliyuncs.com/api/v1/uploads"
4448
headers = {
4549
"Authorization": f"Bearer {api_key}",
4650
"Content-Type": "application/json"

0 commit comments

Comments
 (0)