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 +1 -1
- AgentCrew/modules/agents/local_agent.py +41 -34
- AgentCrew/modules/chat/consolidation.py +3 -2
- AgentCrew/modules/code_analysis/__init__.py +7 -0
- AgentCrew/modules/code_analysis/file_search_service.py +585 -0
- AgentCrew/modules/code_analysis/tool.py +227 -4
- AgentCrew/modules/command_execution/tool.py +5 -2
- AgentCrew/modules/console/console_ui.py +1 -0
- AgentCrew/modules/console/ui_effects.py +3 -3
- AgentCrew/modules/custom_llm/service.py +4 -4
- AgentCrew/modules/file_editing/tree_sitter_checker.py +3 -3
- AgentCrew/modules/llm/constants.py +34 -2
- AgentCrew/modules/mcpclient/service.py +110 -14
- AgentCrew/modules/openai/service.py +4 -4
- AgentCrew/modules/voice/deepinfra_service.py +1 -1
- {agentcrew_ai-0.8.10.dist-info → agentcrew_ai-0.8.11.dist-info}/METADATA +3 -4
- {agentcrew_ai-0.8.10.dist-info → agentcrew_ai-0.8.11.dist-info}/RECORD +21 -20
- {agentcrew_ai-0.8.10.dist-info → agentcrew_ai-0.8.11.dist-info}/WHEEL +0 -0
- {agentcrew_ai-0.8.10.dist-info → agentcrew_ai-0.8.11.dist-info}/entry_points.txt +0 -0
- {agentcrew_ai-0.8.10.dist-info → agentcrew_ai-0.8.11.dist-info}/licenses/LICENSE +0 -0
- {agentcrew_ai-0.8.10.dist-info → agentcrew_ai-0.8.11.dist-info}/top_level.txt +0 -0
AgentCrew/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.8.
|
|
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"""
|
|
592
|
-
|
|
593
|
-
<Project_Behavior> has higher priority than <Global_Behavior
|
|
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
|
-
|
|
623
|
-
|
|
624
|
-
):
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
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"
|
|
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
|
|
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
|
-
#
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
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
|
-
|
|
151
|
-
|
|
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
|