Skip to content

Commit 9a05c19

Browse files
committed
feat(agent): Enhance the adaptive instruction
1 parent 2429400 commit 9a05c19

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

AgentCrew/modules/agents/local_agent.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,15 +587,15 @@ def _build_adaptive_behavior_context(self) -> Dict[str, Any]:
587587
adaptive_text.extend(
588588
[
589589
"<Global_Behavior id='default'>When encountering tasks that you have no data in the context and you don't know the anwser, say I don't know and ask user for helping you find the solution.</Global_Behavior>",
590-
"<Global_Behavior id='transfer'>When first working on a task, consider whether any other agent is more suitable, if yes, transfer to that agent.</Global_Behavior>",
590+
"<Global_Behavior id='transfer'>When working on my request, consider whether if any other agents is more suitable, if yes, transfer to that agent.</Global_Behavior>",
591591
]
592592
)
593593
if len(adaptive_text) > 0:
594594
adaptive_messages["content"].append(
595595
{
596596
"type": "text",
597-
"text": f"""Learn behaviors in the <Adaptive_Behaviors> tags before responding.
598-
If `when` condition in <Global_Behavior> or <Project_Behavior> matches, update your responses with behaviors immediately—they override default instruction.
597+
"text": f"""Go through all behaviors in the <Adaptive_Behaviors> tags before generating responses.
598+
Whenever condition `when` in <Global_Behavior> or <Project_Behavior> matches, tailor your responses with behaviors immediately—they override default instruction.
599599
<Project_Behavior> has higher priority than <Global_Behavior>.
600600
<Adaptive_Behaviors>
601601
{" \n".join(adaptive_text)}
@@ -648,10 +648,11 @@ def _enhance_agent_context_messages(self, final_messages: List[Dict[str, Any]]):
648648
adaptive_messages["content"].append(
649649
{
650650
"type": "text",
651-
"text": f"Below is our conversation history from oldest to latest:\n - {'\n - '.join(memory_headers)}",
651+
"text": f"Check the conversation histories if it related to my request:\n - {'\n - '.join(memory_headers)}",
652652
}
653653
)
654654
if len(adaptive_messages["content"]) > 0:
655+
print(adaptive_messages)
655656
final_messages.insert(last_user_index, adaptive_messages)
656657

657658
agent_manager = self.services.get("agent_manager", None)

0 commit comments

Comments
 (0)