fix: model params

This commit is contained in:
wxg0103 2025-01-23 17:47:36 +08:00
parent cabd6fb7f5
commit 6f6e823117
6 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@ class QwenVLModelCredential(BaseForm, BaseModelCredential):
return False
try:
model = provider.get_model(model_type, model_name, model_credential, **model_params)
res = model.stream([HumanMessage(content=[{"type": "text", "text": _('Hello')}])])
res = model.stream([HumanMessage(content=[{"type": "text", "text": gettext('Hello')}])])
for chunk in res:
print(chunk)
except Exception as e:

View File

@ -40,7 +40,7 @@ class QwenTextToImageModel(MaxKBBaseModel, BaseTextToImage):
def check_auth(self):
chat = ChatTongyi(api_key=self.api_key, model_name='qwen-max')
chat.invoke([HumanMessage([{"type": "text", "text": _('Hello')}])])
chat.invoke([HumanMessage([{"type": "text", "text": gettext('Hello')}])])
def generate_image(self, prompt: str, negative_prompt: str = None):
# api_base='https://dashscope.aliyuncs.com/compatible-mode/v1',

View File

@ -51,7 +51,7 @@ class AzureOpenAIImageModelCredential(BaseForm, BaseModelCredential):
return False
try:
model = provider.get_model(model_type, model_name, model_credential, **model_params)
res = model.stream([HumanMessage(content=[{"type": "text", "text": _('Hello')}])])
res = model.stream([HumanMessage(content=[{"type": "text", "text": gettext('Hello')}])])
for chunk in res:
print(chunk)
except Exception as e:

View File

@ -50,7 +50,7 @@ class OpenAIImageModelCredential(BaseForm, BaseModelCredential):
return False
try:
model = provider.get_model(model_type, model_name, model_credential, **model_params)
res = model.stream([HumanMessage(content=[{"type": "text", "text": _('Hello')}])])
res = model.stream([HumanMessage(content=[{"type": "text", "text": gettext('Hello')}])])
for chunk in res:
print(chunk)
except Exception as e:

View File

@ -40,7 +40,7 @@ class QwenTextToImageModel(MaxKBBaseModel, BaseTextToImage):
def check_auth(self):
chat = ChatTongyi(api_key=self.api_key, model_name='qwen-max')
chat.invoke([HumanMessage([{"type": "text", "text": _('Hello')}])])
chat.invoke([HumanMessage([{"type": "text", "text": gettext('Hello')}])])
def generate_image(self, prompt: str, negative_prompt: str = None):
# api_base='https://dashscope.aliyuncs.com/compatible-mode/v1',

View File

@ -46,7 +46,7 @@ class ZhiPuTextToImage(MaxKBBaseModel, BaseTextToImage):
zhipuai_api_key=self.api_key,
model_name=self.model,
)
chat.invoke([HumanMessage([{"type": "text", "text": _('Hello')}])])
chat.invoke([HumanMessage([{"type": "text", "text": gettext('Hello')}])])
# self.generate_image('生成一个小猫图片')