修复标题语种自适应

This commit is contained in:
zcr
2026-05-19 12:08:28 +08:00
parent 316d027aab
commit 44ce5d0786

View File

@@ -23,15 +23,14 @@ async def conversation_title(agent, config):
break break
prompt = f""" prompt = f"""
请根据以下首次对话内容生成一个简洁、精准的标题2-15个字 Generate a concise and precise title based on the following first-round conversation:
User: {user_msg}
Assistant: {ai_msg}
用户:{user_msg} Rules:
助手:{ai_msg} 1. The title length should be controlled between 2 and 15 characters/word.
2. **The title must be in the same language as the users question**. If the user is Chinese, the output will be Chinese, and if the user is English, the output will be English.
要求: 3. Only return the pure title, no explanation, no punctuation, no book title.
1. 标题需概括对话核心内容
2. 语言简洁、符合中文表达习惯
3. 仅返回标题,不要额外解释
""" """
response = await qwen_plus_llm.ainvoke(prompt) response = await qwen_plus_llm.ainvoke(prompt)
title = response.content.strip() title = response.content.strip()