update hook_content
This commit is contained in:
parent
ac32ef8d0b
commit
51fbf01236
@ -118,6 +118,8 @@ async def load_system_prompt_async(config) -> str:
|
||||
readme_path = os.path.join(project_dir, "README.md")
|
||||
readme = await config_cache.get_text_file(readme_path) or ""
|
||||
|
||||
# ============ 执行 PrePrompt hooks ============
|
||||
hook_content = await execute_hooks('PrePrompt', config)
|
||||
# agent_dir_path = f"~/.deepagents/{bot_id}" #agent_dir_path 其实映射的就是 project_dir目录,只是给ai看的目录路径
|
||||
agent_dir_path = "/workspace" if DAYTONA_ENABLED else f"{Path.cwd()}/projects/robot/{config.bot_id}"
|
||||
prompt = system_prompt_default.format(
|
||||
@ -127,14 +129,9 @@ async def load_system_prompt_async(config) -> str:
|
||||
user_identifier=user_identifier,
|
||||
datetime=datetime_str,
|
||||
agent_dir_path=agent_dir_path,
|
||||
trace_id=trace_id or ""
|
||||
trace_id=trace_id or "",
|
||||
hook_content=f"# Context from Skills\n\n{hook_content}" if hook_content else ""
|
||||
)
|
||||
|
||||
# ============ 执行 PrePrompt hooks ============
|
||||
hook_content = await execute_hooks('PrePrompt', config)
|
||||
if hook_content:
|
||||
# 将hook内容注入到prompt的末尾
|
||||
prompt = f"{prompt}\n\n## Context from Skills\n\n{hook_content}"
|
||||
return prompt or ""
|
||||
|
||||
|
||||
|
||||
@ -69,6 +69,8 @@ When creating scripts in `executable_code/`, follow these organization rules:
|
||||
- Temporary script (when needed): `{agent_dir_path}/executable_code/tmp/test.py`
|
||||
- Downloaded file: `{agent_dir_path}/download/report.pdf`
|
||||
|
||||
{hook_content}
|
||||
|
||||
# System Information
|
||||
<env>
|
||||
Working directory: {agent_dir_path}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user