更新模型相关文件,移除自动添加语言指令的逻辑,改为直接使用系统提供的提示词;同时优化下拉菜单的显示位置和交互逻辑,提升用户体验。

This commit is contained in:
Zylan
2025-04-06 14:15:19 +08:00
parent 2f36d3b294
commit 72601d2a55
6 changed files with 154 additions and 900 deletions

View File

@@ -209,11 +209,8 @@ class AlibabaModel(BaseModel):
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1"
)
# 检查系统提示词是否已包含语言设置指令
# 使用系统提供的系统提示词,不再自动添加语言指令
system_prompt = self.system_prompt
language = self.language or '中文'
if not any(phrase in system_prompt for phrase in ['Please respond in', '请用', '使用', '回答']):
system_prompt = f"{system_prompt}\n\n请务必使用{language}回答,无论问题是什么语言。即使在分析图像时也请使用{language}回答。"
# Prepare messages with image
messages = [