@@ -46,22 +46,23 @@ def new_instance(model_type, model_name, model_credential: Dict[str, object], **
4646 return chat_tong_yi
4747
4848 def check_auth (self ):
49- from openai import OpenAI
50-
51- client = OpenAI (
52- # 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
53- api_key = self .api_key ,
54- base_url = self .api_base ,
55- )
56- client .chat .completions .create (
57- # 模型列表:https://help.aliyun.com/zh/model-studio/getting-started/models
58- model = "qwen-max" ,
59- messages = [
60- {"role" : "system" , "content" : "You are a helpful assistant." },
61- {"role" : "user" , "content" : gettext ('Hello' )},
62- ]
63-
64- )
49+ # from openai import OpenAI
50+ #
51+ # client = OpenAI(
52+ # # 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
53+ # api_key=self.api_key,
54+ # base_url=self.api_base,
55+ # )
56+ # client.chat.completions.create(
57+ # # 模型列表:https://help.aliyun.com/zh/model-studio/getting-started/models
58+ # model="qwen-max",
59+ # messages=[
60+ # {"role": "system", "content": "You are a helpful assistant."},
61+ # {"role": "user", "content": gettext('Hello')},
62+ # ]
63+ #
64+ # )
65+ return True
6566
6667 def generate_image (self , prompt : str , negative_prompt : str = None ):
6768 if self .model_name .startswith ("wan2.6" ) or self .model_name .startswith ("z" ):
@@ -93,7 +94,7 @@ def generate_image(self, prompt: str, negative_prompt: str = None):
9394 raise Exception ('sync_call Failed, status_code: %s, code: %s, message: %s' %
9495 (rsp .status_code , rsp .code , rsp .message ))
9596 return file_urls
96- elif self .model_name .startswith ("wan" ):
97+ elif self .model_name .startswith ("wan" ) or self . model_name . startswith ( "qwen-image-plus" ) :
9798 rsp = ImageSynthesis .call (api_key = self .api_key ,
9899 model = self .model_name ,
99100 base_url = self .api_base ,
0 commit comments