Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

minor workforce and example update

Wendongf503945d67a6
diff --git a/camel/societies/workforce/workforce.py b/camel/societies/workforce/workforce.py
index ba145019a..2619075d2 100644
--- a/camel/societies/workforce/workforce.py
+++ b/camel/societies/workforce/workforce.py
@@ -551,6 +551,10 @@ class Workforce(BaseNode):
continue
if not memory_records:
+ logger.warning(
+ "No valid memory records could be reconstructed "
+ "for sharing"
+ )
return
# Share with coordinator agent
@@ -668,6 +672,12 @@ class Workforce(BaseNode):
if task_id in self._task_start_times:
del self._task_start_times[task_id]
+ if task_id in self._task_dependencies:
+ del self._task_dependencies[task_id]
+
+ if task_id in self._assignees:
+ del self._assignees[task_id]
+
def _decompose_task(self, task: Task) -> List[Task]:
r"""Decompose the task into subtasks. This method will also set the
relationship between the task and its subtasks.
@@ -991,8 +1001,13 @@ class Workforce(BaseNode):
tasks_dict = {task.id: task for task in self._pending_tasks}
# Check if all provided IDs exist
- if not all(task_id in tasks_dict for task_id in task_ids):
- logger.warning("Some task IDs not found in pending tasks.")
+ invalid_ids = [
+ task_id for task_id in task_ids if task_id not in tasks_dict
+ ]
+ if invalid_ids:
+ logger.warning(
+ f"Task IDs not found in pending tasks: {invalid_ids}"
+ )
return False
# Check if we have the same number of tasks
@@ -2057,7 +2072,6 @@ class Workforce(BaseNode):
logger.error(
f"JSON parsing error in worker creation: Invalid "
f"response format - {e}. Response content: "
- f"format - {e}. Response content: "
f"{response.msg.content[:100]}..."
)
raise RuntimeError(
diff --git a/examples/workforce/eigent.py b/examples/workforce/eigent.py
index 9ef1e9224..4bb3ed79e 100644
--- a/examples/workforce/eigent.py
+++ b/examples/workforce/eigent.py
@@ -158,7 +158,7 @@ def search_agent_factory(
browser_log_to_file=True,
stealth=True,
session_id=agent_id, # unique session ID
- default_start_url="https://bing.com/",
+ default_start_url="https://search.brave.com/",
)
tools = [
@@ -168,6 +168,7 @@ def search_agent_factory(
HumanToolkit().ask_human_via_console,
NoteTakingToolkit().append_note,
*Crawl4AIToolkit().get_tools(),
+ SearchToolkit().search_exa,
]
system_message = """You are a helpful assistant that can search the web,