mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-19 07:59:34 +00:00
feat: agent_info prompt shows active preset
This commit is contained in:
parent
16defe4b1b
commit
cd5850bdb3
2 changed files with 8 additions and 1 deletions
|
|
@ -10,11 +10,17 @@ class IncludeAgentInfo(Extension):
|
|||
# read prompt
|
||||
from plugins._model_config.helpers.model_config import get_chat_model_config
|
||||
chat_cfg = get_chat_model_config(self.agent)
|
||||
|
||||
# detect active preset
|
||||
override = self.agent.context.get_data("chat_model_override")
|
||||
preset_name = override.get("preset_name", "") if isinstance(override, dict) else ""
|
||||
|
||||
agent_info_prompt = self.agent.read_prompt(
|
||||
"agent.extras.agent_info.md",
|
||||
number=self.agent.number,
|
||||
profile=self.agent.config.profile or "Default",
|
||||
llm=chat_cfg.get("provider", "") + "/" + chat_cfg.get("name", ""),
|
||||
preset=preset_name,
|
||||
)
|
||||
|
||||
# add agent info to the prompt
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
# Agent info
|
||||
Agent Number: {{number}}
|
||||
Profile: {{profile}}
|
||||
LLM: {{llm}}
|
||||
LLM: {{llm}}
|
||||
{{if preset}}Active Preset: {{preset}}{{endif}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue