Skip to content

Commit a8a9429

Browse files
committed
fix: remove unused OpenAI client initialization in check_auth method
--bug=1066070@tapd-62980211 --user=王孝刚 【模型】阿里万相文生视频、图生视频模型添加失败 https://www.tapd.cn/62980211/s/1841070
1 parent c25af28 commit a8a9429

File tree

1 file changed

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

1 file changed

+1
-16
lines changed

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

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,7 @@ def new_instance(model_type, model_name, model_credential: Dict[str, object], **
4444
)
4545

4646
def check_auth(self):
47-
from openai import OpenAI
48-
49-
client = OpenAI(
50-
# 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
51-
api_key=self.api_key,
52-
base_url=self.api_base,
53-
)
54-
client.chat.completions.create(
55-
# 模型列表:https://help.aliyun.com/zh/model-studio/getting-started/models
56-
model="qwen-max",
57-
messages=[
58-
{"role": "system", "content": "You are a helpful assistant."},
59-
{"role": "user", "content": gettext('Hello')},
60-
]
61-
62-
)
47+
return True
6348

6449
def _safe_call(self, func, **kwargs):
6550
"""带重试的请求封装"""

0 commit comments

Comments
 (0)