mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-29 12:10:57 +00:00
initial message polishing
This commit is contained in:
parent
ff29f2b12d
commit
0aa6201d3d
4 changed files with 18 additions and 9 deletions
|
|
@ -15,10 +15,14 @@ class InitialMessage(Extension):
|
|||
if self.agent.number != 0:
|
||||
return
|
||||
|
||||
# If the context already contains log messages, do not add another initial message
|
||||
if self.agent.context.log.logs:
|
||||
return
|
||||
|
||||
# Construct the initial message from prompt template
|
||||
initial_message = self.agent.read_prompt("fw.initial_message.md")
|
||||
|
||||
# add loop data to agent
|
||||
# add initial loop data to agent (for hist_add_ai_response)
|
||||
self.agent.loop_data = LoopData(user_message=None)
|
||||
|
||||
# Add the message to history as an AI response
|
||||
|
|
@ -32,5 +36,7 @@ class InitialMessage(Extension):
|
|||
self.agent.context.log.log(
|
||||
type="response",
|
||||
heading=f"{self.agent.agent_name}: Welcome",
|
||||
content=initial_message_text
|
||||
).update(finished=True)
|
||||
content=initial_message_text,
|
||||
finished=True,
|
||||
update_progress="none",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue