|
26 | 26 | from agents.matmaster_agent.core_agents.comp_agents.dntransfer_climit_agent import ( |
27 | 27 | DisallowTransferAndContentLimitLlmAgent, |
28 | 28 | ) |
| 29 | +from agents.matmaster_agent.flow_agents.all_finished_agent.callback import ( |
| 30 | + only_select_user_request, |
| 31 | +) |
29 | 32 | from agents.matmaster_agent.flow_agents.all_finished_agent.constant import ( |
30 | 33 | ALL_FINISHED_AGENT, |
31 | 34 | ) |
@@ -228,6 +231,7 @@ def after_init(self): |
228 | 231 | description='检查用户的目标是否完成', |
229 | 232 | output_schema=AllFinishedSchema, |
230 | 233 | state_key=FINISHED_STATE, |
| 234 | + before_model_callback=only_select_user_request, |
231 | 235 | ) |
232 | 236 |
|
233 | 237 | self._analysis_agent = DisallowTransferAndContentLimitLlmAgent( |
@@ -790,10 +794,11 @@ async def _run_research_flow( |
790 | 794 | yield _plan_execute_event |
791 | 795 |
|
792 | 796 | # 回顾历史执行 |
| 797 | + user_request = ctx.user_content.parts[0].text |
793 | 798 | history_steps = ctx.session.state[HISTORY_STEPS] |
794 | 799 | session_files = await get_session_files(ctx.session.id) |
795 | 800 | self.all_finished_agent.instruction = create_all_finished_instruction( |
796 | | - history_steps, session_files |
| 801 | + user_request, history_steps, session_files |
797 | 802 | ) |
798 | 803 | async for _all_finished_event in self.all_finished_agent.run_async(ctx): |
799 | 804 | yield _all_finished_event |
|
0 commit comments