agentcrew-ai 0.8.10__py3-none-any.whl → 0.8.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
AgentCrew/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.8.10"
1
+ __version__ = "0.8.11"
@@ -584,13 +584,19 @@ You must analyze then execute it with your available tools and give answer witho
584
584
  for key, value in local_adaptive_behaviors.items()
585
585
  ]
586
586
  )
587
+ adaptive_text.extend(
588
+ [
589
+ "<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 working on my request, consider whether if any other agents is more suitable, if yes, transfer to that agent.</Global_Behavior>",
591
+ ]
592
+ )
587
593
  if len(adaptive_text) > 0:
588
594
  adaptive_messages["content"].append(
589
595
  {
590
596
  "type": "text",
591
- "text": f"""<MANDATORY>APPLY list of <Adaptive_Behaviors> before responding.
592
- Check if `when` condition in <Global_Behavior> or <Project_Behavior> matches, update your responses with behaviors immediately—they override default instruction.
593
- <Project_Behavior> has higher priority than <Global_Behavior>.</MANDATORY>
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.
599
+ <Project_Behavior> has higher priority than <Global_Behavior>.
594
600
  <Adaptive_Behaviors>
595
601
  {" \n".join(adaptive_text)}
596
602
  </Adaptive_Behaviors>""",
@@ -618,22 +624,22 @@ Check if `when` condition in <Global_Behavior> or <Project_Behavior> matches, up
618
624
  .find("<Transfer_Tool>")
619
625
  != 0
620
626
  ):
621
- if (
622
- self.services.get("agent_manager")
623
- and self.services["agent_manager"].enforce_transfer
624
- ):
625
- adaptive_messages["content"].insert(
626
- 0,
627
- {
628
- "type": "text",
629
- "text": """Before processing my request:
630
- - Break my request into sub-tasks when applicable.
631
- - For each sub-task, evaluate other agents capabilities.
632
- - Transfer sub-task to other agent if they are more suitable.
633
- - Keep the evaluating quick and concise using xml format within <agent_evaluation> tags.
634
- - Skip agent evaluation if user request is when...,[action]... related to adaptive behaviors call `adapt` tool instead.""",
635
- },
636
- )
627
+ # if (
628
+ # self.services.get("agent_manager")
629
+ # and self.services["agent_manager"].enforce_transfer
630
+ # ):
631
+ # adaptive_messages["content"].insert(
632
+ # 0,
633
+ # {
634
+ # "type": "text",
635
+ # "text": """Before processing my request:
636
+ # - Break my request into sub-tasks when applicable.
637
+ # - For each sub-task, evaluate other agents capabilities.
638
+ # - Transfer sub-task to other agent if they are more suitable.
639
+ # - Keep the evaluating quick and concise using xml format within <agent_evaluation> tags.
640
+ # - Skip agent evaluation if user request is when...,[action]... related to adaptive behaviors call `adapt` tool instead.""",
641
+ # },
642
+ # )
637
643
  if not self.is_remoting_mode and self.services.get("memory"):
638
644
  memory_headers = self.services["memory"].list_memory_headers(
639
645
  agent_name=self.name
@@ -642,7 +648,7 @@ Check if `when` condition in <Global_Behavior> or <Project_Behavior> matches, up
642
648
  adaptive_messages["content"].append(
643
649
  {
644
650
  "type": "text",
645
- "text": f"Here are conversations that we have discussed 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)}",
646
652
  }
647
653
  )
648
654
  if len(adaptive_messages["content"]) > 0:
@@ -665,7 +671,7 @@ Check if `when` condition in <Global_Behavior> or <Project_Behavior> matches, up
665
671
  "content": [
666
672
  {
667
673
  "type": "text",
668
- "text": f"""<Transfer_Reminder>Make sure to transfer after the task is completed: {agent_manager.defered_transfer}</Transfer_Reminder>""",
674
+ "text": f"""<Transfer_Reminder>Make sure to transfer the task result after the task is completed to {agent_manager.defered_transfer}</Transfer_Reminder>""",
669
675
  }
670
676
  ],
671
677
  },
@@ -713,19 +719,20 @@ Check if `when` condition in <Global_Behavior> or <Project_Behavior> matches, up
713
719
  elif msg.get("role") == "tool":
714
720
  tool_name = msg.get("tool_name", "")
715
721
 
716
- # Remove denied tools after agent correct it
717
- if msg.get("is_rejected", False):
718
- has_last_user_message = next(
719
- (True for _ in final_messages[i:] if msg.get("role") == "user"),
720
- False,
721
- )
722
- if has_last_user_message:
723
- tool_id = msg.get("tool_call_id", "")
724
- last_assistant_msg = final_messages[i - 1]
725
- for tool_call in last_assistant_msg.get("tool_calls", []):
726
- if tool_call.get("id", "") == tool_id:
727
- tool_call["arguments"] = {}
728
- break
722
+ # TODO: this will be failed if agent call tool in parallel
723
+ # # Remove denied tools after agent correct it
724
+ # if msg.get("is_rejected", False):
725
+ # has_last_user_message = next(
726
+ # (True for _ in final_messages[i:] if msg.get("role") == "user"),
727
+ # False,
728
+ # )
729
+ # if has_last_user_message:
730
+ # tool_id = msg.get("tool_call_id", "")
731
+ # last_assistant_msg = final_messages[i - 1]
732
+ # for tool_call in last_assistant_msg.get("tool_calls", []):
733
+ # if tool_call.get("id", "") == tool_id:
734
+ # tool_call["arguments"] = {}
735
+ # break
729
736
 
730
737
  if tool_name in shrink_excluded:
731
738
  continue
@@ -147,8 +147,9 @@ class ConversationConsolidator:
147
147
  prefix = "USER: "
148
148
  elif role == "assistant":
149
149
  prefix = f"{agent_name.upper()}: "
150
- elif role == "tool":
151
- prefix = f"TOOL ({msg.get('name', 'unknown')}): "
150
+ # Skip the tool data for saving tokens in summary
151
+ # elif role == "tool":
152
+ # prefix = f"TOOL ({msg.get('name', 'unknown')}): "
152
153
  elif role == "consolidated":
153
154
  # If we're summarizing a section that already has a consolidated message,
154
155
  # include it directly to preserve that context
@@ -1,3 +1,10 @@
1
+ """
2
+ Code Analysis Module
3
+
4
+ This module provides code structure analysis using tree-sitter and file search
5
+ capabilities with platform-specific optimizations.
6
+ """
7
+
1
8
  from .service import CodeAnalysisService
2
9
 
3
10
  __all__ = [