修复 title 总结失败bug,新增enable_thinking参数
This commit is contained in:
@@ -39,6 +39,7 @@ async def chat_stream(request: DeepAgentChatRequest):
|
||||
|
||||
#### 2. 请求参数
|
||||
* `message`: 用户的设计意图(如:'我想设计一个极简风格的橡木办公桌')。
|
||||
* `enable_thinking`: 是否开启思考模式。
|
||||
* `quote_image_path`: 用户引用图片地址 如:"fida-test/furniture/sketches/8a1804d1-5ac9-4d02-bf17-e65fa7272f65.png"。
|
||||
* `input_image_paths`: 用户上传图片地址集合如:["fida-test/furniture/sketches/8a1804d1-5ac9-4d02-bf17-e65fa7272f65.png"]。
|
||||
* `thread_id`: (可选) 现有项目的唯一标识。若不传,系统将自动分配并返回。
|
||||
@@ -106,7 +107,7 @@ async def chat_stream(request: DeepAgentChatRequest):
|
||||
# 构建主agent
|
||||
workspace_dir = os.path.join(PROJECT_ROOT, f"agent_workspace/{target_thread_id}")
|
||||
logger.info(f"chat request data: {request} | target_thread_id : workspace_dir: {workspace_dir}")
|
||||
main_agent = build_main_agent(request.use_report, workspace_dir)
|
||||
main_agent = build_main_agent(request.use_report, workspace_dir, request.enable_thinking)
|
||||
# 2. 配置參數
|
||||
temp = request.config_params.temperature if request.config_params else 0.7
|
||||
|
||||
@@ -318,7 +319,7 @@ async def chat_stream(request: DeepAgentChatRequest):
|
||||
# 获取标题
|
||||
if need_title:
|
||||
title = await conversation_title(agent=main_agent, config=current_config)
|
||||
logger.info(f"[need_title] {title}")
|
||||
logger.info(f"[title] {title}")
|
||||
yield f"data: {json.dumps({'title': title}, ensure_ascii=False)}\n\n"
|
||||
|
||||
yield f"data: {json.dumps({'status': 'end'}, ensure_ascii=False)}\n\n"
|
||||
|
||||
Reference in New Issue
Block a user