From d3001d8148a1342eec6093c97d913228ab940b26 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Mon, 1 Dec 2025 17:40:30 +0800 Subject: [PATCH] fix: update file name handling in InternalAgentSubStage to correctly associate file names with extracted content --- .../process_stage/method/agent_sub_stages/internal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py b/astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py index c4baeaa6..b70c35b5 100644 --- a/astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py +++ b/astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py @@ -156,11 +156,11 @@ class InternalAgentSubStage(Stage): return # add file extract results to contexts - for file_content in file_contents: + for file_content, file_name in zip(file_contents, file_names): req.contexts.append( { "role": "system", - "content": f"File Extract Results of user uploaded files:\n{file_content}\nFile Name: {file_names or 'Unknown'}", + "content": f"File Extract Results of user uploaded files:\n{file_content}\nFile Name: {file_name or 'Unknown'}", }, )