refactor: unify system prompt injection into _openai_stream; disable gpt done_hooks

This commit is contained in:
Liang Jiaqing
2026-04-23 20:07:20 +08:00
parent 6091bf0c6f
commit df2a7749b4
2 changed files with 7 additions and 7 deletions

View File

@@ -138,7 +138,7 @@ class GeneraticAgent:
user_input = raw_query
if source == 'feishu' and len(self.history) > 1: # 如果有历史记录且来自飞书,注入到首轮 user_input 中(支持/restore恢复上下文
user_input = handler._get_anchor_prompt() + f"\n\n### 用户当前消息\n{raw_query}"
if 'gpt' in self.get_llm_name(model=True): handler._done_hooks.append('请确定任务是否完成如果完成请给出信息完整的简报回答如未完成需要继续工具调用直到完成任务确实需要问用户应使用ask_user工具')
#if 'gpt' in self.get_llm_name(model=True): handler._done_hooks.append('请确定任务是否完成如果完成请给出信息完整的简报回答如未完成需要继续工具调用直到完成任务确实需要问用户应使用ask_user工具')
# although new handler, the **full** history is in llmclient, so it is full history!
gen = agent_runner_loop(self.llmclient, sys_prompt, user_input,
handler, TOOLS_SCHEMA, max_turns=70, verbose=self.verbose)