mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-06 08:01:31 +00:00
fix: backend not setting agent no; agent no in responses
This commit is contained in:
parent
74595c6e8d
commit
6ed9f068c6
3 changed files with 10 additions and 2 deletions
|
|
@ -20,7 +20,9 @@ class LogForStream(Extension):
|
|||
)
|
||||
|
||||
def build_heading(agent, text: str, icon: str = "network_intelligence"):
|
||||
return f"icon://{icon} {text}"
|
||||
# Include agent identifier for all agents (A0:, A1:, A2:, etc.)
|
||||
agent_prefix = f"{agent.agent_name}: "
|
||||
return f"icon://{icon} {agent_prefix}{text}"
|
||||
|
||||
def build_default_heading(agent):
|
||||
return build_heading(agent, "Generating...")
|
||||
|
|
@ -30,7 +30,7 @@ class LiveResponse(Extension):
|
|||
loop_data.params_temporary["log_item_response"] = (
|
||||
self.agent.context.log.log(
|
||||
type="response",
|
||||
heading=f"icon://chat Responding",
|
||||
heading=f"icon://chat {self.agent.agent_name}: Responding",
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -214,10 +214,16 @@ class Log:
|
|||
) -> LogItem:
|
||||
|
||||
# add a minimal item to the log
|
||||
# Determine agent number from streaming agent
|
||||
agent_number = 0
|
||||
if self.context and self.context.streaming_agent:
|
||||
agent_number = self.context.streaming_agent.number
|
||||
|
||||
item = LogItem(
|
||||
log=self,
|
||||
no=len(self.logs),
|
||||
type=type,
|
||||
agent_number=agent_number,
|
||||
)
|
||||
# Set duration on previous item and mark it as updated
|
||||
if self.logs:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue