|
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 | ) |
@@ -229,6 +232,7 @@ def after_init(self): |
229 | 232 | description='检查用户的目标是否完成', |
230 | 233 | output_schema=AllFinishedSchema, |
231 | 234 | state_key=FINISHED_STATE, |
| 235 | + before_model_callback=only_select_user_request, |
232 | 236 | ) |
233 | 237 |
|
234 | 238 | self._analysis_agent = DisallowTransferAndContentLimitLlmAgent( |
@@ -809,10 +813,11 @@ async def _run_research_flow( |
809 | 813 | yield _plan_execute_event |
810 | 814 |
|
811 | 815 | # 回顾历史执行 |
| 816 | + user_request = ctx.user_content.parts[0].text |
812 | 817 | history_steps = ctx.session.state[HISTORY_STEPS] |
813 | 818 | session_files = await get_session_files(ctx.session.id) |
814 | 819 | self.all_finished_agent.instruction = create_all_finished_instruction( |
815 | | - history_steps, session_files |
| 820 | + user_request, history_steps, session_files |
816 | 821 | ) |
817 | 822 | async for _all_finished_event in self.all_finished_agent.run_async(ctx): |
818 | 823 | yield _all_finished_event |
|
0 commit comments