camel-ai 0.2.71a11__py3-none-any.whl → 0.2.72a0__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.
Potentially problematic release.
This version of camel-ai might be problematic. Click here for more details.
- camel/__init__.py +1 -1
- camel/agents/chat_agent.py +1 -1
- camel/models/moonshot_model.py +36 -4
- camel/societies/workforce/prompts.py +1 -1
- camel/societies/workforce/role_playing_worker.py +1 -1
- camel/societies/workforce/worker.py +1 -1
- camel/societies/workforce/workforce.py +97 -34
- camel/tasks/task.py +9 -5
- camel/toolkits/search_toolkit.py +142 -78
- camel/utils/tool_result.py +1 -1
- {camel_ai-0.2.71a11.dist-info → camel_ai-0.2.72a0.dist-info}/METADATA +1 -1
- {camel_ai-0.2.71a11.dist-info → camel_ai-0.2.72a0.dist-info}/RECORD +14 -14
- {camel_ai-0.2.71a11.dist-info → camel_ai-0.2.72a0.dist-info}/WHEEL +0 -0
- {camel_ai-0.2.71a11.dist-info → camel_ai-0.2.72a0.dist-info}/licenses/LICENSE +0 -0
camel/__init__.py
CHANGED
camel/agents/chat_agent.py
CHANGED
camel/models/moonshot_model.py
CHANGED
|
@@ -20,6 +20,7 @@ from pydantic import BaseModel
|
|
|
20
20
|
|
|
21
21
|
from camel.configs import MOONSHOT_API_PARAMS, MoonshotConfig
|
|
22
22
|
from camel.messages import OpenAIMessage
|
|
23
|
+
from camel.models._utils import try_modify_message_with_format
|
|
23
24
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
24
25
|
from camel.types import (
|
|
25
26
|
ChatCompletion,
|
|
@@ -106,6 +107,38 @@ class MoonshotModel(OpenAICompatibleModel):
|
|
|
106
107
|
**kwargs,
|
|
107
108
|
)
|
|
108
109
|
|
|
110
|
+
def _prepare_request(
|
|
111
|
+
self,
|
|
112
|
+
messages: List[OpenAIMessage],
|
|
113
|
+
response_format: Optional[Type[BaseModel]] = None,
|
|
114
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
115
|
+
) -> Dict[str, Any]:
|
|
116
|
+
r"""Prepare the request configuration for Moonshot API.
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
messages (List[OpenAIMessage]): Message list with the chat history
|
|
120
|
+
in OpenAI API format.
|
|
121
|
+
response_format (Optional[Type[BaseModel]]): The format of the
|
|
122
|
+
response.
|
|
123
|
+
tools (Optional[List[Dict[str, Any]]]): The schema of the tools to
|
|
124
|
+
use for the request.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
Dict[str, Any]: The prepared request configuration.
|
|
128
|
+
"""
|
|
129
|
+
import copy
|
|
130
|
+
|
|
131
|
+
request_config = copy.deepcopy(self.model_config_dict)
|
|
132
|
+
|
|
133
|
+
if tools:
|
|
134
|
+
request_config["tools"] = tools
|
|
135
|
+
elif response_format:
|
|
136
|
+
# Use the same approach as DeepSeek for structured output
|
|
137
|
+
try_modify_message_with_format(messages[-1], response_format)
|
|
138
|
+
request_config["response_format"] = {"type": "json_object"}
|
|
139
|
+
|
|
140
|
+
return request_config
|
|
141
|
+
|
|
109
142
|
@observe()
|
|
110
143
|
async def _arun(
|
|
111
144
|
self,
|
|
@@ -141,10 +174,9 @@ class MoonshotModel(OpenAICompatibleModel):
|
|
|
141
174
|
tags=["CAMEL-AI", str(self.model_type)],
|
|
142
175
|
)
|
|
143
176
|
|
|
144
|
-
request_config = self.
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
request_config["tools"] = tools
|
|
177
|
+
request_config = self._prepare_request(
|
|
178
|
+
messages, response_format, tools
|
|
179
|
+
)
|
|
148
180
|
|
|
149
181
|
return await self._async_client.chat.completions.create(
|
|
150
182
|
messages=messages,
|
|
@@ -147,7 +147,7 @@ Here is the content of the parent task for you to refer to:
|
|
|
147
147
|
Here are results of some prerequisite tasks that you can refer to:
|
|
148
148
|
|
|
149
149
|
==============================
|
|
150
|
-
{
|
|
150
|
+
{dependency_tasks_info}
|
|
151
151
|
==============================
|
|
152
152
|
|
|
153
153
|
Here are some additional information about the task:
|
|
@@ -122,7 +122,7 @@ class RolePlayingWorker(Worker):
|
|
|
122
122
|
prompt = ROLEPLAY_PROCESS_TASK_PROMPT.format(
|
|
123
123
|
content=task.content,
|
|
124
124
|
parent_task_content=task.parent.content if task.parent else "",
|
|
125
|
-
|
|
125
|
+
dependency_tasks_info=dependency_tasks_info,
|
|
126
126
|
additional_info=task.additional_info,
|
|
127
127
|
)
|
|
128
128
|
role_play_session = RolePlaying(
|
|
@@ -1008,7 +1008,7 @@ class Workforce(BaseNode):
|
|
|
1008
1008
|
if not validate_task_content(new_content, task_id):
|
|
1009
1009
|
logger.warning(
|
|
1010
1010
|
f"Task {task_id} content modification rejected: "
|
|
1011
|
-
f"Invalid content. Content preview: '{new_content
|
|
1011
|
+
f"Invalid content. Content preview: '{new_content}'"
|
|
1012
1012
|
)
|
|
1013
1013
|
return False
|
|
1014
1014
|
|
|
@@ -1194,7 +1194,7 @@ class Workforce(BaseNode):
|
|
|
1194
1194
|
task.result = "Task failed: Invalid or empty content provided"
|
|
1195
1195
|
logger.warning(
|
|
1196
1196
|
f"Task {task.id} rejected: Invalid or empty content. "
|
|
1197
|
-
f"Content preview: '{task.content
|
|
1197
|
+
f"Content preview: '{task.content}'"
|
|
1198
1198
|
)
|
|
1199
1199
|
return task
|
|
1200
1200
|
|
|
@@ -1327,7 +1327,7 @@ class Workforce(BaseNode):
|
|
|
1327
1327
|
task.result = "Task failed: Invalid or empty content provided"
|
|
1328
1328
|
logger.warning(
|
|
1329
1329
|
f"Task {task.id} rejected: Invalid or empty content. "
|
|
1330
|
-
f"Content preview: '{task.content
|
|
1330
|
+
f"Content preview: '{task.content}'"
|
|
1331
1331
|
)
|
|
1332
1332
|
return task
|
|
1333
1333
|
|
|
@@ -1721,23 +1721,51 @@ class Workforce(BaseNode):
|
|
|
1721
1721
|
|
|
1722
1722
|
def _get_child_nodes_info(self) -> str:
|
|
1723
1723
|
r"""Get the information of all the child nodes under this node."""
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1724
|
+
return "".join(
|
|
1725
|
+
f"<{child.node_id}>:<{child.description}>:<{self._get_node_info(child)}>\n"
|
|
1726
|
+
for child in self._children
|
|
1727
|
+
)
|
|
1728
|
+
|
|
1729
|
+
def _get_node_info(self, node) -> str:
|
|
1730
|
+
r"""Get descriptive information for a specific node type."""
|
|
1731
|
+
if isinstance(node, Workforce):
|
|
1732
|
+
return "A Workforce node"
|
|
1733
|
+
elif isinstance(node, SingleAgentWorker):
|
|
1734
|
+
return self._get_single_agent_info(node)
|
|
1735
|
+
elif isinstance(node, RolePlayingWorker):
|
|
1736
|
+
return "A Role playing node"
|
|
1737
|
+
else:
|
|
1738
|
+
return "Unknown node"
|
|
1739
|
+
|
|
1740
|
+
def _get_single_agent_info(self, worker: 'SingleAgentWorker') -> str:
|
|
1741
|
+
r"""Get formatted information for a SingleAgentWorker node."""
|
|
1742
|
+
toolkit_tools = self._group_tools_by_toolkit(worker.worker.tool_dict)
|
|
1743
|
+
|
|
1744
|
+
if not toolkit_tools:
|
|
1745
|
+
return "no tools available"
|
|
1746
|
+
|
|
1747
|
+
toolkit_info = []
|
|
1748
|
+
for toolkit_name, tools in sorted(toolkit_tools.items()):
|
|
1749
|
+
tools_str = ', '.join(sorted(tools))
|
|
1750
|
+
toolkit_info.append(f"{toolkit_name}({tools_str})")
|
|
1751
|
+
|
|
1752
|
+
return " | ".join(toolkit_info)
|
|
1753
|
+
|
|
1754
|
+
def _group_tools_by_toolkit(self, tool_dict: dict) -> dict[str, list[str]]:
|
|
1755
|
+
r"""Group tools by their parent toolkit class names."""
|
|
1756
|
+
toolkit_tools: dict[str, list[str]] = {}
|
|
1757
|
+
|
|
1758
|
+
for tool_name, tool in tool_dict.items():
|
|
1759
|
+
if hasattr(tool.func, '__self__'):
|
|
1760
|
+
toolkit_name = tool.func.__self__.__class__.__name__
|
|
1734
1761
|
else:
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
)
|
|
1740
|
-
|
|
1762
|
+
toolkit_name = "Standalone"
|
|
1763
|
+
|
|
1764
|
+
if toolkit_name not in toolkit_tools:
|
|
1765
|
+
toolkit_tools[toolkit_name] = []
|
|
1766
|
+
toolkit_tools[toolkit_name].append(tool_name)
|
|
1767
|
+
|
|
1768
|
+
return toolkit_tools
|
|
1741
1769
|
|
|
1742
1770
|
def _get_valid_worker_ids(self) -> set:
|
|
1743
1771
|
r"""Get all valid worker IDs from child nodes.
|
|
@@ -1853,7 +1881,7 @@ class Workforce(BaseNode):
|
|
|
1853
1881
|
logger.error(
|
|
1854
1882
|
f"JSON parsing error in task assignment: Invalid response "
|
|
1855
1883
|
f"format - {e}. Response content: "
|
|
1856
|
-
f"{response.msg.content
|
|
1884
|
+
f"{response.msg.content}"
|
|
1857
1885
|
)
|
|
1858
1886
|
return TaskAssignResult(assignments=[])
|
|
1859
1887
|
|
|
@@ -1985,6 +2013,37 @@ class Workforce(BaseNode):
|
|
|
1985
2013
|
|
|
1986
2014
|
return final_assignments
|
|
1987
2015
|
|
|
2016
|
+
def _update_task_dependencies_from_assignments(
|
|
2017
|
+
self, assignments: List[TaskAssignment], tasks: List[Task]
|
|
2018
|
+
) -> None:
|
|
2019
|
+
r"""Update Task.dependencies with actual Task objects based on
|
|
2020
|
+
assignments.
|
|
2021
|
+
|
|
2022
|
+
Args:
|
|
2023
|
+
assignments (List[TaskAssignment]): The task assignments
|
|
2024
|
+
containing dependency IDs.
|
|
2025
|
+
tasks (List[Task]): The tasks that were assigned.
|
|
2026
|
+
"""
|
|
2027
|
+
# Create a lookup map for all available tasks
|
|
2028
|
+
all_tasks = {}
|
|
2029
|
+
for task_list in [self._completed_tasks, self._pending_tasks, tasks]:
|
|
2030
|
+
for task in task_list:
|
|
2031
|
+
all_tasks[task.id] = task
|
|
2032
|
+
|
|
2033
|
+
# Update dependencies for each assigned task
|
|
2034
|
+
for assignment in assignments:
|
|
2035
|
+
if not assignment.dependencies:
|
|
2036
|
+
continue
|
|
2037
|
+
|
|
2038
|
+
matching_tasks = [t for t in tasks if t.id == assignment.task_id]
|
|
2039
|
+
if matching_tasks:
|
|
2040
|
+
task = matching_tasks[0]
|
|
2041
|
+
task.dependencies = [
|
|
2042
|
+
all_tasks[dep_id]
|
|
2043
|
+
for dep_id in assignment.dependencies
|
|
2044
|
+
if dep_id in all_tasks
|
|
2045
|
+
]
|
|
2046
|
+
|
|
1988
2047
|
async def _find_assignee(
|
|
1989
2048
|
self,
|
|
1990
2049
|
tasks: List[Task],
|
|
@@ -2021,19 +2080,24 @@ class Workforce(BaseNode):
|
|
|
2021
2080
|
|
|
2022
2081
|
# if all assignments are valid and all tasks are assigned, return early
|
|
2023
2082
|
if not invalid_assignments and not unassigned_tasks:
|
|
2083
|
+
self._update_task_dependencies_from_assignments(
|
|
2084
|
+
valid_assignments, tasks
|
|
2085
|
+
)
|
|
2024
2086
|
return TaskAssignResult(assignments=valid_assignments)
|
|
2025
2087
|
|
|
2026
|
-
# handle retry and fallback for
|
|
2027
|
-
#
|
|
2028
|
-
all_problem_assignments = invalid_assignments
|
|
2088
|
+
# handle retry and fallback for invalid assignments and unassigned
|
|
2089
|
+
# tasks
|
|
2029
2090
|
retry_and_fallback_assignments = (
|
|
2030
2091
|
await self._handle_assignment_retry_and_fallback(
|
|
2031
|
-
|
|
2092
|
+
invalid_assignments, tasks, valid_worker_ids
|
|
2032
2093
|
)
|
|
2033
2094
|
)
|
|
2034
|
-
valid_assignments
|
|
2095
|
+
all_assignments = valid_assignments + retry_and_fallback_assignments
|
|
2096
|
+
|
|
2097
|
+
# Update Task.dependencies for all final assignments
|
|
2098
|
+
self._update_task_dependencies_from_assignments(all_assignments, tasks)
|
|
2035
2099
|
|
|
2036
|
-
return TaskAssignResult(assignments=
|
|
2100
|
+
return TaskAssignResult(assignments=all_assignments)
|
|
2037
2101
|
|
|
2038
2102
|
async def _post_task(self, task: Task, assignee_id: str) -> None:
|
|
2039
2103
|
# Record the start time when a task is posted
|
|
@@ -2107,7 +2171,7 @@ class Workforce(BaseNode):
|
|
|
2107
2171
|
)
|
|
2108
2172
|
new_node_conf = WorkerConf(
|
|
2109
2173
|
description=f"Fallback worker for task: "
|
|
2110
|
-
f"{task.content
|
|
2174
|
+
f"{task.content}",
|
|
2111
2175
|
role="General Assistant",
|
|
2112
2176
|
sys_msg="You are a general assistant that can help "
|
|
2113
2177
|
"with various tasks.",
|
|
@@ -2117,8 +2181,7 @@ class Workforce(BaseNode):
|
|
|
2117
2181
|
response.msg.content,
|
|
2118
2182
|
schema=WorkerConf,
|
|
2119
2183
|
fallback_values={
|
|
2120
|
-
"description": f"Worker for task: "
|
|
2121
|
-
f"{task.content[:50]}...",
|
|
2184
|
+
"description": f"Worker for task: " f"{task.content}",
|
|
2122
2185
|
"role": "Task Specialist",
|
|
2123
2186
|
"sys_msg": f"You are a specialist for: {task.content}",
|
|
2124
2187
|
},
|
|
@@ -2130,7 +2193,7 @@ class Workforce(BaseNode):
|
|
|
2130
2193
|
new_node_conf = WorkerConf(**result)
|
|
2131
2194
|
else:
|
|
2132
2195
|
new_node_conf = WorkerConf(
|
|
2133
|
-
description=f"Worker for task: {task.content
|
|
2196
|
+
description=f"Worker for task: {task.content}",
|
|
2134
2197
|
role="Task Specialist",
|
|
2135
2198
|
sys_msg=f"You are a specialist for: {task.content}",
|
|
2136
2199
|
)
|
|
@@ -2147,7 +2210,7 @@ class Workforce(BaseNode):
|
|
|
2147
2210
|
# Create a fallback worker configuration
|
|
2148
2211
|
new_node_conf = WorkerConf(
|
|
2149
2212
|
description=f"Fallback worker for "
|
|
2150
|
-
f"task: {task.content
|
|
2213
|
+
f"task: {task.content}",
|
|
2151
2214
|
role="General Assistant",
|
|
2152
2215
|
sys_msg="You are a general assistant that can help "
|
|
2153
2216
|
"with various tasks.",
|
|
@@ -2160,7 +2223,7 @@ class Workforce(BaseNode):
|
|
|
2160
2223
|
logger.error(
|
|
2161
2224
|
f"JSON parsing error in worker creation: Invalid "
|
|
2162
2225
|
f"response format - {e}. Response content: "
|
|
2163
|
-
f"{response.msg.content
|
|
2226
|
+
f"{response.msg.content}"
|
|
2164
2227
|
)
|
|
2165
2228
|
raise RuntimeError(
|
|
2166
2229
|
f"Failed to create worker for task {task.id}: "
|
|
@@ -2364,7 +2427,7 @@ class Workforce(BaseNode):
|
|
|
2364
2427
|
f"Task {task.id} has exceeded maximum retry attempts "
|
|
2365
2428
|
f"({MAX_TASK_RETRIES}). Final failure "
|
|
2366
2429
|
f"reason: {detailed_error}. "
|
|
2367
|
-
f"Task content: '{task.content
|
|
2430
|
+
f"Task content: '{task.content}'"
|
|
2368
2431
|
)
|
|
2369
2432
|
self._cleanup_task_tracking(task.id)
|
|
2370
2433
|
# Mark task as completed for dependency tracking before halting
|
|
@@ -2793,7 +2856,7 @@ class Workforce(BaseNode):
|
|
|
2793
2856
|
# useful results
|
|
2794
2857
|
if is_task_result_insufficient(returned_task):
|
|
2795
2858
|
result_preview = (
|
|
2796
|
-
returned_task.result
|
|
2859
|
+
returned_task.result
|
|
2797
2860
|
if returned_task.result
|
|
2798
2861
|
else "No result"
|
|
2799
2862
|
)
|
camel/tasks/task.py
CHANGED
|
@@ -99,7 +99,7 @@ def validate_task_content(
|
|
|
99
99
|
logger.warning(
|
|
100
100
|
f"Task {task_id}: Content too short ({len(stripped_content)} "
|
|
101
101
|
f"chars < {min_length} minimum). Content preview: "
|
|
102
|
-
f"'{stripped_content
|
|
102
|
+
f"'{stripped_content}'"
|
|
103
103
|
)
|
|
104
104
|
return False
|
|
105
105
|
|
|
@@ -124,7 +124,7 @@ def validate_task_content(
|
|
|
124
124
|
if any(indicator in content_lower for indicator in failure_indicators):
|
|
125
125
|
logger.warning(
|
|
126
126
|
f"Task {task_id}: Failure indicator detected in result. "
|
|
127
|
-
f"Content preview: '{stripped_content
|
|
127
|
+
f"Content preview: '{stripped_content}'"
|
|
128
128
|
)
|
|
129
129
|
return False
|
|
130
130
|
|
|
@@ -132,7 +132,7 @@ def validate_task_content(
|
|
|
132
132
|
if content_lower.startswith(("error", "failed", "cannot", "unable")):
|
|
133
133
|
logger.warning(
|
|
134
134
|
f"Task {task_id}: Error/refusal pattern detected at start. "
|
|
135
|
-
f"Content preview: '{stripped_content
|
|
135
|
+
f"Content preview: '{stripped_content}'"
|
|
136
136
|
)
|
|
137
137
|
return False
|
|
138
138
|
|
|
@@ -195,7 +195,7 @@ def parse_response(
|
|
|
195
195
|
logger.warning(
|
|
196
196
|
f"Skipping invalid subtask {task_id}.{i} "
|
|
197
197
|
f"during decomposition: "
|
|
198
|
-
f"Content '{stripped_content
|
|
198
|
+
f"Content '{stripped_content}' failed validation"
|
|
199
199
|
)
|
|
200
200
|
return tasks
|
|
201
201
|
|
|
@@ -233,6 +233,8 @@ class Task(BaseModel):
|
|
|
233
233
|
(default: :obj:`0`)
|
|
234
234
|
assigned_worker_id (Optional[str]): The ID of the worker assigned to
|
|
235
235
|
this task. (default: :obj:`None`)
|
|
236
|
+
dependencies (List[Task]): The dependencies for the task.
|
|
237
|
+
(default: :obj:`[]`)
|
|
236
238
|
additional_info (Optional[Dict[str, Any]]): Additional information for
|
|
237
239
|
the task. (default: :obj:`None`)
|
|
238
240
|
image_list (Optional[List[Image.Image]]): Optional list of PIL Image
|
|
@@ -265,6 +267,8 @@ class Task(BaseModel):
|
|
|
265
267
|
|
|
266
268
|
assigned_worker_id: Optional[str] = None
|
|
267
269
|
|
|
270
|
+
dependencies: List["Task"] = []
|
|
271
|
+
|
|
268
272
|
additional_info: Optional[Dict[str, Any]] = None
|
|
269
273
|
|
|
270
274
|
image_list: Optional[List[Image.Image]] = None
|
|
@@ -530,7 +534,7 @@ class Task(BaseModel):
|
|
|
530
534
|
logger.warning(
|
|
531
535
|
f"Skipping invalid subtask {task_id}.{i} "
|
|
532
536
|
f"during streaming decomposition: "
|
|
533
|
-
f"Content '{stripped_content
|
|
537
|
+
f"Content '{stripped_content}' failed validation"
|
|
534
538
|
)
|
|
535
539
|
return tasks
|
|
536
540
|
|
camel/toolkits/search_toolkit.py
CHANGED
|
@@ -32,6 +32,23 @@ class SearchToolkit(BaseToolkit):
|
|
|
32
32
|
search engines like Google, DuckDuckGo, Wikipedia and Wolfram Alpha, Brave.
|
|
33
33
|
"""
|
|
34
34
|
|
|
35
|
+
def __init__(
|
|
36
|
+
self,
|
|
37
|
+
timeout: Optional[float] = None,
|
|
38
|
+
number_of_result_pages: int = 10,
|
|
39
|
+
):
|
|
40
|
+
r"""Initializes the RedditToolkit with the specified number of retries
|
|
41
|
+
and delay.
|
|
42
|
+
|
|
43
|
+
Args:
|
|
44
|
+
timeout (float): Timeout for API requests in seconds.
|
|
45
|
+
(default: :obj:`None`)
|
|
46
|
+
number_of_result_pages (int): The number of result pages to
|
|
47
|
+
retrieve. (default: :obj:`10`)
|
|
48
|
+
"""
|
|
49
|
+
super().__init__(timeout=timeout)
|
|
50
|
+
self.number_of_result_pages = number_of_result_pages
|
|
51
|
+
|
|
35
52
|
@dependencies_required("wikipedia")
|
|
36
53
|
def search_wiki(self, entity: str) -> str:
|
|
37
54
|
r"""Search the entity in WikiPedia and return the summary of the
|
|
@@ -144,7 +161,7 @@ class SearchToolkit(BaseToolkit):
|
|
|
144
161
|
|
|
145
162
|
@dependencies_required("duckduckgo_search")
|
|
146
163
|
def search_duckduckgo(
|
|
147
|
-
self, query: str, source: str = "text"
|
|
164
|
+
self, query: str, source: str = "text"
|
|
148
165
|
) -> List[Dict[str, Any]]:
|
|
149
166
|
r"""Use DuckDuckGo search engine to search information for
|
|
150
167
|
the given query.
|
|
@@ -157,7 +174,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
157
174
|
query (str): The query to be searched.
|
|
158
175
|
source (str): The type of information to query (e.g., "text",
|
|
159
176
|
"images", "videos"). Defaults to "text".
|
|
160
|
-
max_results (int): Max number of results, defaults to `5`.
|
|
161
177
|
|
|
162
178
|
Returns:
|
|
163
179
|
List[Dict[str, Any]]: A list of dictionaries where each dictionary
|
|
@@ -171,7 +187,9 @@ class SearchToolkit(BaseToolkit):
|
|
|
171
187
|
|
|
172
188
|
if source == "text":
|
|
173
189
|
try:
|
|
174
|
-
results = ddgs.text(
|
|
190
|
+
results = ddgs.text(
|
|
191
|
+
keywords=query, max_results=self.number_of_result_pages
|
|
192
|
+
)
|
|
175
193
|
except RequestException as e:
|
|
176
194
|
# Handle specific exceptions or general request exceptions
|
|
177
195
|
responses.append({"error": f"duckduckgo search failed.{e}"})
|
|
@@ -189,7 +207,9 @@ class SearchToolkit(BaseToolkit):
|
|
|
189
207
|
|
|
190
208
|
elif source == "images":
|
|
191
209
|
try:
|
|
192
|
-
results = ddgs.images(
|
|
210
|
+
results = ddgs.images(
|
|
211
|
+
keywords=query, max_results=self.number_of_result_pages
|
|
212
|
+
)
|
|
193
213
|
except RequestException as e:
|
|
194
214
|
# Handle specific exceptions or general request exceptions
|
|
195
215
|
responses.append({"error": f"duckduckgo search failed.{e}"})
|
|
@@ -208,7 +228,9 @@ class SearchToolkit(BaseToolkit):
|
|
|
208
228
|
|
|
209
229
|
elif source == "videos":
|
|
210
230
|
try:
|
|
211
|
-
results = ddgs.videos(
|
|
231
|
+
results = ddgs.videos(
|
|
232
|
+
keywords=query, max_results=self.number_of_result_pages
|
|
233
|
+
)
|
|
212
234
|
except RequestException as e:
|
|
213
235
|
# Handle specific exceptions or general request exceptions
|
|
214
236
|
responses.append({"error": f"duckduckgo search failed.{e}"})
|
|
@@ -241,7 +263,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
241
263
|
country: str = "US",
|
|
242
264
|
search_lang: str = "en",
|
|
243
265
|
ui_lang: str = "en-US",
|
|
244
|
-
count: int = 20,
|
|
245
266
|
offset: int = 0,
|
|
246
267
|
safesearch: str = "moderate",
|
|
247
268
|
freshness: Optional[str] = None,
|
|
@@ -277,10 +298,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
277
298
|
Format: '<language_code>-<country_code>'. Common examples:
|
|
278
299
|
'en-US', 'en-GB', 'jp-JP', 'zh-hans-CN', 'zh-hant-TW',
|
|
279
300
|
'de-DE', 'fr-FR', 'es-ES', 'pt-BR', 'ru-RU', 'ko-KR'.
|
|
280
|
-
count (int): The number of search results returned in response.
|
|
281
|
-
The maximum is 20. The actual number delivered may be less than
|
|
282
|
-
requested. Combine this parameter with offset to paginate
|
|
283
|
-
search results.
|
|
284
301
|
offset (int): The zero based offset that indicates number of search
|
|
285
302
|
results per page (count) to skip before returning the result.
|
|
286
303
|
The maximum is 9. The actual number delivered may be less than
|
|
@@ -368,7 +385,7 @@ class SearchToolkit(BaseToolkit):
|
|
|
368
385
|
"country": country,
|
|
369
386
|
"search_lang": search_lang,
|
|
370
387
|
"ui_lang": ui_lang,
|
|
371
|
-
"count":
|
|
388
|
+
"count": self.number_of_result_pages,
|
|
372
389
|
"offset": offset,
|
|
373
390
|
"safesearch": safesearch,
|
|
374
391
|
"freshness": freshness,
|
|
@@ -418,25 +435,36 @@ class SearchToolkit(BaseToolkit):
|
|
|
418
435
|
]
|
|
419
436
|
)
|
|
420
437
|
def search_google(
|
|
421
|
-
self, query: str,
|
|
438
|
+
self, query: str, search_type: str = "web"
|
|
422
439
|
) -> List[Dict[str, Any]]:
|
|
423
440
|
r"""Use Google search engine to search information for the given query.
|
|
424
441
|
|
|
425
442
|
Args:
|
|
426
443
|
query (str): The query to be searched.
|
|
427
|
-
|
|
444
|
+
search_type (str): The type of search to perform. Either "web" for
|
|
445
|
+
web pages or "image" for image search. (default: "web")
|
|
428
446
|
|
|
429
447
|
Returns:
|
|
430
448
|
List[Dict[str, Any]]: A list of dictionaries where each dictionary
|
|
431
|
-
represents a
|
|
432
|
-
|
|
449
|
+
represents a search result.
|
|
450
|
+
|
|
451
|
+
For web search, each dictionary contains:
|
|
433
452
|
- 'result_id': A number in order.
|
|
434
453
|
- 'title': The title of the website.
|
|
435
454
|
- 'description': A brief description of the website.
|
|
436
455
|
- 'long_description': More detail of the website.
|
|
437
456
|
- 'url': The URL of the website.
|
|
438
457
|
|
|
439
|
-
|
|
458
|
+
For image search, each dictionary contains:
|
|
459
|
+
- 'result_id': A number in order.
|
|
460
|
+
- 'title': The title of the image.
|
|
461
|
+
- 'image_url': The URL of the image.
|
|
462
|
+
- 'display_link': The website hosting the image.
|
|
463
|
+
- 'context_url': The URL of the page containing the image.
|
|
464
|
+
- 'width': Image width in pixels (if available).
|
|
465
|
+
- 'height': Image height in pixels (if available).
|
|
466
|
+
|
|
467
|
+
Example web result:
|
|
440
468
|
{
|
|
441
469
|
'result_id': 1,
|
|
442
470
|
'title': 'OpenAI',
|
|
@@ -448,7 +476,17 @@ class SearchToolkit(BaseToolkit):
|
|
|
448
476
|
benefit humanity as a whole',
|
|
449
477
|
'url': 'https://www.openai.com'
|
|
450
478
|
}
|
|
451
|
-
|
|
479
|
+
|
|
480
|
+
Example image result:
|
|
481
|
+
{
|
|
482
|
+
'result_id': 1,
|
|
483
|
+
'title': 'Beautiful Sunset',
|
|
484
|
+
'image_url': 'https://example.com/image.jpg',
|
|
485
|
+
'display_link': 'example.com',
|
|
486
|
+
'context_url': 'https://example.com/page.html',
|
|
487
|
+
'width': 800,
|
|
488
|
+
'height': 600
|
|
489
|
+
}
|
|
452
490
|
"""
|
|
453
491
|
import requests
|
|
454
492
|
|
|
@@ -461,16 +499,20 @@ class SearchToolkit(BaseToolkit):
|
|
|
461
499
|
start_page_idx = 1
|
|
462
500
|
# Different language may get different result
|
|
463
501
|
search_language = "en"
|
|
464
|
-
# How many pages to return
|
|
465
|
-
num_result_pages = num_result_pages
|
|
466
502
|
# Constructing the URL
|
|
467
503
|
# Doc: https://developers.google.com/custom-search/v1/using_rest
|
|
468
|
-
|
|
504
|
+
base_url = (
|
|
469
505
|
f"https://www.googleapis.com/customsearch/v1?"
|
|
470
506
|
f"key={GOOGLE_API_KEY}&cx={SEARCH_ENGINE_ID}&q={query}&start="
|
|
471
|
-
f"{start_page_idx}&lr={search_language}&num={
|
|
507
|
+
f"{start_page_idx}&lr={search_language}&num={self.number_of_result_pages}"
|
|
472
508
|
)
|
|
473
509
|
|
|
510
|
+
# Add searchType parameter for image search
|
|
511
|
+
if search_type == "image":
|
|
512
|
+
url = base_url + "&searchType=image"
|
|
513
|
+
else:
|
|
514
|
+
url = base_url
|
|
515
|
+
|
|
474
516
|
responses = []
|
|
475
517
|
# Fetch the results given the URL
|
|
476
518
|
try:
|
|
@@ -482,37 +524,68 @@ class SearchToolkit(BaseToolkit):
|
|
|
482
524
|
if "items" in data:
|
|
483
525
|
search_items = data.get("items")
|
|
484
526
|
|
|
485
|
-
# Iterate over
|
|
527
|
+
# Iterate over results found
|
|
486
528
|
for i, search_item in enumerate(search_items, start=1):
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
529
|
+
if search_type == "image":
|
|
530
|
+
# Process image search results
|
|
531
|
+
title = search_item.get("title")
|
|
532
|
+
image_url = search_item.get("link")
|
|
533
|
+
display_link = search_item.get("displayLink")
|
|
534
|
+
|
|
535
|
+
# Get context URL (page containing the image)
|
|
536
|
+
image_info = search_item.get("image", {})
|
|
537
|
+
context_url = image_info.get("contextLink", "")
|
|
538
|
+
|
|
539
|
+
# Get image dimensions if available
|
|
540
|
+
width = image_info.get("width")
|
|
541
|
+
height = image_info.get("height")
|
|
542
|
+
|
|
543
|
+
response = {
|
|
544
|
+
"result_id": i,
|
|
545
|
+
"title": title,
|
|
546
|
+
"image_url": image_url,
|
|
547
|
+
"display_link": display_link,
|
|
548
|
+
"context_url": context_url,
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
# Add dimensions if available
|
|
552
|
+
if width:
|
|
553
|
+
response["width"] = int(width)
|
|
554
|
+
if height:
|
|
555
|
+
response["height"] = int(height)
|
|
556
|
+
|
|
557
|
+
responses.append(response)
|
|
499
558
|
else:
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
559
|
+
# Process web search results (existing logic)
|
|
560
|
+
# Check metatags are present
|
|
561
|
+
if "pagemap" not in search_item:
|
|
562
|
+
continue
|
|
563
|
+
if "metatags" not in search_item["pagemap"]:
|
|
564
|
+
continue
|
|
565
|
+
if (
|
|
566
|
+
"og:description"
|
|
567
|
+
in search_item["pagemap"]["metatags"][0]
|
|
568
|
+
):
|
|
569
|
+
long_description = search_item["pagemap"][
|
|
570
|
+
"metatags"
|
|
571
|
+
][0]["og:description"]
|
|
572
|
+
else:
|
|
573
|
+
long_description = "N/A"
|
|
574
|
+
# Get the page title
|
|
575
|
+
title = search_item.get("title")
|
|
576
|
+
# Page snippet
|
|
577
|
+
snippet = search_item.get("snippet")
|
|
578
|
+
|
|
579
|
+
# Extract the page url
|
|
580
|
+
link = search_item.get("link")
|
|
581
|
+
response = {
|
|
582
|
+
"result_id": i,
|
|
583
|
+
"title": title,
|
|
584
|
+
"description": snippet,
|
|
585
|
+
"long_description": long_description,
|
|
586
|
+
"url": link,
|
|
587
|
+
}
|
|
588
|
+
responses.append(response)
|
|
516
589
|
else:
|
|
517
590
|
error_info = data.get("error", {})
|
|
518
591
|
logger.error(
|
|
@@ -529,15 +602,11 @@ class SearchToolkit(BaseToolkit):
|
|
|
529
602
|
responses.append({"error": f"google search failed: {e!s}"})
|
|
530
603
|
return responses
|
|
531
604
|
|
|
532
|
-
def tavily_search(
|
|
533
|
-
self, query: str, num_results: int = 5, **kwargs
|
|
534
|
-
) -> List[Dict[str, Any]]:
|
|
605
|
+
def tavily_search(self, query: str, **kwargs) -> List[Dict[str, Any]]:
|
|
535
606
|
r"""Use Tavily Search API to search information for the given query.
|
|
536
607
|
|
|
537
608
|
Args:
|
|
538
609
|
query (str): The query to be searched.
|
|
539
|
-
num_results (int): The number of search results to retrieve
|
|
540
|
-
(default is `5`).
|
|
541
610
|
**kwargs: Additional optional parameters supported by Tavily's API:
|
|
542
611
|
- search_depth (str): "basic" or "advanced" search depth.
|
|
543
612
|
- topic (str): The search category, e.g., "general" or "news."
|
|
@@ -573,7 +642,9 @@ class SearchToolkit(BaseToolkit):
|
|
|
573
642
|
client = TavilyClient(Tavily_API_KEY)
|
|
574
643
|
|
|
575
644
|
try:
|
|
576
|
-
results = client.search(
|
|
645
|
+
results = client.search(
|
|
646
|
+
query, max_results=self.number_of_result_pages, **kwargs
|
|
647
|
+
)
|
|
577
648
|
return results
|
|
578
649
|
except Exception as e:
|
|
579
650
|
return [{"error": f"An unexpected error occurred: {e!s}"}]
|
|
@@ -584,7 +655,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
584
655
|
query: str,
|
|
585
656
|
freshness: str = "noLimit",
|
|
586
657
|
summary: bool = False,
|
|
587
|
-
count: int = 10,
|
|
588
658
|
page: int = 1,
|
|
589
659
|
) -> Dict[str, Any]:
|
|
590
660
|
r"""Query the Bocha AI search API and return search results.
|
|
@@ -600,7 +670,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
600
670
|
- 'oneYear': past year.
|
|
601
671
|
summary (bool): Whether to include text summaries in results.
|
|
602
672
|
Default is False.
|
|
603
|
-
count (int): Number of results to return (1-50). Default is 10.
|
|
604
673
|
page (int): Page number of results. Default is 1.
|
|
605
674
|
|
|
606
675
|
Returns:
|
|
@@ -623,7 +692,7 @@ class SearchToolkit(BaseToolkit):
|
|
|
623
692
|
"query": query,
|
|
624
693
|
"freshness": freshness,
|
|
625
694
|
"summary": summary,
|
|
626
|
-
"count":
|
|
695
|
+
"count": self.number_of_result_pages,
|
|
627
696
|
"page": page,
|
|
628
697
|
},
|
|
629
698
|
ensure_ascii=False,
|
|
@@ -641,15 +710,13 @@ class SearchToolkit(BaseToolkit):
|
|
|
641
710
|
except requests.exceptions.RequestException as e:
|
|
642
711
|
return {"error": f"Bocha AI search failed: {e!s}"}
|
|
643
712
|
|
|
644
|
-
def search_baidu(self, query: str
|
|
713
|
+
def search_baidu(self, query: str) -> Dict[str, Any]:
|
|
645
714
|
r"""Search Baidu using web scraping to retrieve relevant search
|
|
646
715
|
results. This method queries Baidu's search engine and extracts search
|
|
647
716
|
results including titles, descriptions, and URLs.
|
|
648
717
|
|
|
649
718
|
Args:
|
|
650
719
|
query (str): Search query string to submit to Baidu.
|
|
651
|
-
max_results (int): Maximum number of results to return.
|
|
652
|
-
(default: :obj:`5`)
|
|
653
720
|
|
|
654
721
|
Returns:
|
|
655
722
|
Dict[str, Any]: A dictionary containing search results or error
|
|
@@ -667,7 +734,7 @@ class SearchToolkit(BaseToolkit):
|
|
|
667
734
|
),
|
|
668
735
|
"Referer": "https://www.baidu.com",
|
|
669
736
|
}
|
|
670
|
-
params = {"wd": query, "rn": str(
|
|
737
|
+
params = {"wd": query, "rn": str(self.number_of_result_pages)}
|
|
671
738
|
|
|
672
739
|
response = requests.get(url, headers=headers, params=params)
|
|
673
740
|
response.encoding = "utf-8"
|
|
@@ -696,7 +763,7 @@ class SearchToolkit(BaseToolkit):
|
|
|
696
763
|
"url": link,
|
|
697
764
|
}
|
|
698
765
|
)
|
|
699
|
-
if len(results) >=
|
|
766
|
+
if len(results) >= self.number_of_result_pages:
|
|
700
767
|
break
|
|
701
768
|
|
|
702
769
|
if not results:
|
|
@@ -710,7 +777,7 @@ class SearchToolkit(BaseToolkit):
|
|
|
710
777
|
except Exception as e:
|
|
711
778
|
return {"error": f"Baidu scraping error: {e!s}"}
|
|
712
779
|
|
|
713
|
-
def search_bing(self, query: str
|
|
780
|
+
def search_bing(self, query: str) -> Dict[str, Any]:
|
|
714
781
|
r"""Use Bing search engine to search information for the given query.
|
|
715
782
|
|
|
716
783
|
This function queries the Chinese version of Bing search engine (cn.
|
|
@@ -722,8 +789,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
722
789
|
Args:
|
|
723
790
|
query (str): The search query string to submit to Bing. Works best
|
|
724
791
|
with Chinese queries or when Chinese results are preferred.
|
|
725
|
-
max_results (int): Maximum number of results to return.
|
|
726
|
-
(default: :obj:`5`)
|
|
727
792
|
|
|
728
793
|
Returns:
|
|
729
794
|
Dict ([str, Any]): A dictionary containing either:
|
|
@@ -773,7 +838,9 @@ class SearchToolkit(BaseToolkit):
|
|
|
773
838
|
result_items = b_results_tag.find_all("li")
|
|
774
839
|
|
|
775
840
|
results: List[Dict[str, Any]] = []
|
|
776
|
-
for i in range(
|
|
841
|
+
for i in range(
|
|
842
|
+
min(len(result_items), self.number_of_result_pages)
|
|
843
|
+
):
|
|
777
844
|
row = result_items[i]
|
|
778
845
|
if not isinstance(row, Tag):
|
|
779
846
|
continue
|
|
@@ -838,7 +905,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
838
905
|
"financial report",
|
|
839
906
|
]
|
|
840
907
|
] = None,
|
|
841
|
-
num_results: int = 10,
|
|
842
908
|
include_text: Optional[List[str]] = None,
|
|
843
909
|
exclude_text: Optional[List[str]] = None,
|
|
844
910
|
use_autoprompt: bool = True,
|
|
@@ -854,8 +920,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
854
920
|
and neural search. (default: :obj:`"auto"`)
|
|
855
921
|
category (Optional[Literal]): Category to focus the search on, such
|
|
856
922
|
as "research paper" or "news". (default: :obj:`None`)
|
|
857
|
-
num_results (int): Number of results to return (max 100).
|
|
858
|
-
(default: :obj:`10`)
|
|
859
923
|
include_text (Optional[List[str]]): Strings that must be present in
|
|
860
924
|
webpage text. Limited to 1 string of up to 5 words.
|
|
861
925
|
(default: :obj:`None`)
|
|
@@ -884,7 +948,10 @@ class SearchToolkit(BaseToolkit):
|
|
|
884
948
|
try:
|
|
885
949
|
exa = Exa(EXA_API_KEY)
|
|
886
950
|
|
|
887
|
-
if
|
|
951
|
+
if (
|
|
952
|
+
self.number_of_result_pages is not None
|
|
953
|
+
and not 0 < self.number_of_result_pages <= 100
|
|
954
|
+
):
|
|
888
955
|
raise ValueError("num_results must be between 1 and 100")
|
|
889
956
|
|
|
890
957
|
if include_text is not None:
|
|
@@ -911,7 +978,7 @@ class SearchToolkit(BaseToolkit):
|
|
|
911
978
|
query=query,
|
|
912
979
|
type=search_type,
|
|
913
980
|
category=category,
|
|
914
|
-
num_results=
|
|
981
|
+
num_results=self.number_of_result_pages,
|
|
915
982
|
include_text=include_text,
|
|
916
983
|
exclude_text=exclude_text,
|
|
917
984
|
use_autoprompt=use_autoprompt,
|
|
@@ -925,7 +992,7 @@ class SearchToolkit(BaseToolkit):
|
|
|
925
992
|
query=query,
|
|
926
993
|
type=search_type,
|
|
927
994
|
category=category,
|
|
928
|
-
num_results=
|
|
995
|
+
num_results=self.number_of_result_pages,
|
|
929
996
|
include_text=include_text,
|
|
930
997
|
exclude_text=exclude_text,
|
|
931
998
|
use_autoprompt=use_autoprompt,
|
|
@@ -955,7 +1022,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
955
1022
|
"news_center",
|
|
956
1023
|
]
|
|
957
1024
|
] = None,
|
|
958
|
-
page: int = 1,
|
|
959
1025
|
return_main_text: bool = False,
|
|
960
1026
|
return_markdown_text: bool = True,
|
|
961
1027
|
enable_rerank: bool = True,
|
|
@@ -980,8 +1046,6 @@ class SearchToolkit(BaseToolkit):
|
|
|
980
1046
|
results from sites in the specified industries. Multiple
|
|
981
1047
|
industries can be comma-separated.
|
|
982
1048
|
(default: :obj:`None`)
|
|
983
|
-
page (int): Page number for results pagination.
|
|
984
|
-
(default: :obj:`1`)
|
|
985
1049
|
return_main_text (bool): Whether to include the main text of the
|
|
986
1050
|
webpage in results. (default: :obj:`True`)
|
|
987
1051
|
return_markdown_text (bool): Whether to include markdown formatted
|
|
@@ -1014,7 +1078,7 @@ class SearchToolkit(BaseToolkit):
|
|
|
1014
1078
|
params: Dict[str, Union[str, int]] = {
|
|
1015
1079
|
"query": query,
|
|
1016
1080
|
"timeRange": time_range,
|
|
1017
|
-
"page":
|
|
1081
|
+
"page": self.number_of_result_pages,
|
|
1018
1082
|
"returnMainText": str(return_main_text).lower(),
|
|
1019
1083
|
"returnMarkdownText": str(return_markdown_text).lower(),
|
|
1020
1084
|
"enableRerank": str(enable_rerank).lower(),
|
camel/utils/tool_result.py
CHANGED
|
@@ -41,4 +41,4 @@ class ToolResult:
|
|
|
41
41
|
def __repr__(self) -> str:
|
|
42
42
|
r"""Return a detailed representation of the result."""
|
|
43
43
|
img_count = len(self.images) if self.images else 0
|
|
44
|
-
return f"ToolResult(text='{self.text
|
|
44
|
+
return f"ToolResult(text='{self.text}', images={img_count})"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
camel/__init__.py,sha256=
|
|
1
|
+
camel/__init__.py,sha256=wLBIcsBrpiqBVm22ZM1QiqPDGdAJarjbYDk7mQbmAiw,901
|
|
2
2
|
camel/generators.py,sha256=JRqj9_m1PF4qT6UtybzTQ-KBT9MJQt18OAAYvQ_fr2o,13844
|
|
3
3
|
camel/human.py,sha256=Xg8x1cS5KK4bQ1SDByiHZnzsRpvRP-KZViNvmu38xo4,5475
|
|
4
4
|
camel/logger.py,sha256=WgEwael_eT6D-lVAKHpKIpwXSTjvLbny5jbV1Ab8lnA,5760
|
|
@@ -7,7 +7,7 @@ camel/agents/__init__.py,sha256=64weKqdvmpZcGWyVkO-OKASAmVUdrQjv60JApgPk_SA,1644
|
|
|
7
7
|
camel/agents/_types.py,sha256=MeFZzay2kJA6evALQ-MbBTKW-0lu_0wBuKsxzH_4gWI,1552
|
|
8
8
|
camel/agents/_utils.py,sha256=AR7Qqgbkmn4X2edYUQf1rdksGUyV5hm3iK1z-Dn0Mcg,6266
|
|
9
9
|
camel/agents/base.py,sha256=c4bJYL3G3Z41SaFdMPMn8ZjLdFiFaVOFO6EQIfuCVR8,1124
|
|
10
|
-
camel/agents/chat_agent.py,sha256=
|
|
10
|
+
camel/agents/chat_agent.py,sha256=gF-Wq1YSL5C4_9pp9SN4jdfLrzF-d3xi51PnskQyi7k,159299
|
|
11
11
|
camel/agents/critic_agent.py,sha256=L6cTbYjyZB0DCa51tQ6LZLA6my8kHLC4nktHySH78H4,10433
|
|
12
12
|
camel/agents/deductive_reasoner_agent.py,sha256=6BZGaq1hR6hKJuQtOfoYQnk_AkZpw_Mr7mUy2MspQgs,13540
|
|
13
13
|
camel/agents/embodied_agent.py,sha256=XBxBu5ZMmSJ4B2U3Z7SMwvLlgp6yNpaBe8HNQmY9CZA,7536
|
|
@@ -193,7 +193,7 @@ camel/models/mistral_model.py,sha256=ipOVPk2boGqyGAypgKeQ9syaP0znKFQQSOqeVtockjk
|
|
|
193
193
|
camel/models/model_factory.py,sha256=8b-LEXovPnpmD3GFKOdbtcgjCwpa91IPCJxikPxhdMs,12114
|
|
194
194
|
camel/models/model_manager.py,sha256=ln3bCV_QWM3V5BrwKwjmxIeRN8ojIvPEBMMHun0MliU,9942
|
|
195
195
|
camel/models/modelscope_model.py,sha256=meO7KCAwZtHpUVgwtuKe0j4jYh0IWsxa8e3mwyhGLvg,10804
|
|
196
|
-
camel/models/moonshot_model.py,sha256=
|
|
196
|
+
camel/models/moonshot_model.py,sha256=sghzSd9Ya7AysHYW5gqVSUTThusvwFWFeLRj-6okkLk,7662
|
|
197
197
|
camel/models/nemotron_model.py,sha256=PzRuQoAEmBRZ2wcotQ8-MRz5wYachKa_CUNenMQg-3U,3091
|
|
198
198
|
camel/models/netmind_model.py,sha256=YKHfntqsKqBxfh6qryn4L7CzHOIAYtyPXwJNK6NxNi4,4276
|
|
199
199
|
camel/models/novita_model.py,sha256=V-g0Wrf1Zh1il6oPKh1LVy_U0nveOwJq9YBVzGp4GOI,4238
|
|
@@ -273,14 +273,14 @@ camel/societies/babyagi_playing.py,sha256=KbTdpHfZ2V8AripVck0bNTOyF-RSaMPCRARz3D
|
|
|
273
273
|
camel/societies/role_playing.py,sha256=0XScr3WfxX1QOC71RhBLmrcS5y2c7DMQB_mAFOHU34M,31421
|
|
274
274
|
camel/societies/workforce/__init__.py,sha256=bkTI-PE-MSK9AQ2V2gR6cR2WY-R7Jqy_NmXRtAoqo8o,920
|
|
275
275
|
camel/societies/workforce/base.py,sha256=z2DmbTP5LL5-aCAAqglznQqCLfPmnyM5zD3w6jjtsb8,2175
|
|
276
|
-
camel/societies/workforce/prompts.py,sha256=
|
|
277
|
-
camel/societies/workforce/role_playing_worker.py,sha256=
|
|
276
|
+
camel/societies/workforce/prompts.py,sha256=CYTkUJOYr3lcQAVAUAeKa_R-oyQHl5aECOkriMcXmjM,16518
|
|
277
|
+
camel/societies/workforce/role_playing_worker.py,sha256=Zm89lZTlV0T3o9C-DJ0HAV68Iq2Kdg8QqJRWs1TV9_A,10320
|
|
278
278
|
camel/societies/workforce/single_agent_worker.py,sha256=fXgAEkDMhvTd-nbwy5Gw3BOaRAiPsL8mf3AW1aaNqKU,19342
|
|
279
279
|
camel/societies/workforce/structured_output_handler.py,sha256=xr8szFN86hg3jQ825aEkJTjkSFQnTlbinVg4j1vZJVI,17870
|
|
280
280
|
camel/societies/workforce/task_channel.py,sha256=GWHaGQBpjTzdKbWoBYAQzzAiLKRKRXa6beqtc4cg-Is,7611
|
|
281
281
|
camel/societies/workforce/utils.py,sha256=THgNHSeZsNVnjTzQTur3qCJhi72MrDS8X2gPET174cI,8434
|
|
282
|
-
camel/societies/workforce/worker.py,sha256=
|
|
283
|
-
camel/societies/workforce/workforce.py,sha256=
|
|
282
|
+
camel/societies/workforce/worker.py,sha256=MtUqYkTC9V-PIIRwSkKiB9w_YSu92iOpoha2rktEiQ0,6248
|
|
283
|
+
camel/societies/workforce/workforce.py,sha256=kD6j6h81cNjeGQMECDCMIUiS8OSy1nVF7Ef2IDAiea0,140636
|
|
284
284
|
camel/societies/workforce/workforce_logger.py,sha256=0YT__ys48Bgn0IICKIZBmSWhON-eA1KShebjCdn5ppE,24525
|
|
285
285
|
camel/storages/__init__.py,sha256=RwpEyvxpMbJzVDZJJygeBg4AzyYMkTjjkfB53hTuqGo,2141
|
|
286
286
|
camel/storages/graph_storages/__init__.py,sha256=G29BNn651C0WTOpjCl4QnVM-4B9tcNh8DdmsCiONH8Y,948
|
|
@@ -310,7 +310,7 @@ camel/storages/vectordb_storages/qdrant.py,sha256=a_cT0buSCHQ2CPZy852-mdvMDwy5zo
|
|
|
310
310
|
camel/storages/vectordb_storages/tidb.py,sha256=w83bxgKgso43MtHqlpf2EMSpn1_Nz6ZZtY4fPw_-vgs,11192
|
|
311
311
|
camel/storages/vectordb_storages/weaviate.py,sha256=wDUE4KvfmOl3DqHFU4uF0VKbHu-q9vKhZDe8FZ6QXsk,27888
|
|
312
312
|
camel/tasks/__init__.py,sha256=MuHwkw5GRQc8NOCzj8tjtBrr2Xg9KrcKp-ed_-2ZGIM,906
|
|
313
|
-
camel/tasks/task.py,sha256=
|
|
313
|
+
camel/tasks/task.py,sha256=TZ0h9L_yKuJ3lxs8c8YUNVCZLWJChoy03Z8WXy1i6pc,24212
|
|
314
314
|
camel/tasks/task_prompt.py,sha256=3KZmKYKUPcTKe8EAZOZBN3G05JHRVt7oHY9ORzLVu1g,2150
|
|
315
315
|
camel/terminators/__init__.py,sha256=t8uqrkUnXEOYMXQDgaBkMFJ0EXFKI0kmx4cUimli3Ls,991
|
|
316
316
|
camel/terminators/base.py,sha256=xmJzERX7GdSXcxZjAHHODa0rOxRChMSRboDCNHWSscs,1511
|
|
@@ -366,7 +366,7 @@ camel/toolkits/pulse_mcp_search_toolkit.py,sha256=uLUpm19uC_4xLJow0gGVS9f-5T5EW2
|
|
|
366
366
|
camel/toolkits/pyautogui_toolkit.py,sha256=Q810fm8cFvElRory7B74aqS2YV6BOpdRE6jkewoM8xc,16093
|
|
367
367
|
camel/toolkits/reddit_toolkit.py,sha256=x0XAT1zQJVNHUr1R1HwWCgIlkamU-kPmbfb_H1WIv-w,8036
|
|
368
368
|
camel/toolkits/retrieval_toolkit.py,sha256=BKjEyOqW3cGEPTS5yHPYb-Qg795iNNPIs1wjowfuq3U,3825
|
|
369
|
-
camel/toolkits/search_toolkit.py,sha256=
|
|
369
|
+
camel/toolkits/search_toolkit.py,sha256=_Gvb-h3BImexrIFHT0BvmdosOuIgR_IZvERPdf190K8,47615
|
|
370
370
|
camel/toolkits/searxng_toolkit.py,sha256=a2GtE4FGSrmaIVvX6Yide-abBYD1wsHqitnDlx9fdVg,7664
|
|
371
371
|
camel/toolkits/semantic_scholar_toolkit.py,sha256=Rh7eA_YPxV5pvPIzhjjvpr3vtlaCniJicrqzkPWW9_I,11634
|
|
372
372
|
camel/toolkits/slack_toolkit.py,sha256=ZT6Ndlce2qjGsyZaNMfQ54nSEi7DOC9Ro7YqtK-u5O4,11651
|
|
@@ -435,7 +435,7 @@ camel/utils/mcp_client.py,sha256=-EIUj6v2hXB75Xvj2FyEedwUMEpUUVXzXWNLLYGrJfE,373
|
|
|
435
435
|
camel/utils/message_summarizer.py,sha256=7AvPDlevle5uU3mXtfvSFS--nDjp9yqfrf546qTe9rE,5939
|
|
436
436
|
camel/utils/response_format.py,sha256=xZcx6xBxeg3A0e7R0JCMJdNm2oQ1-diqVLs0JsiCkZU,5319
|
|
437
437
|
camel/utils/token_counting.py,sha256=apkERzNoVc4sgvJvWVosvepX3KH8pVypVjrL4AA7RB4,17521
|
|
438
|
-
camel/utils/tool_result.py,sha256=
|
|
438
|
+
camel/utils/tool_result.py,sha256=0dKMb22cwuxnjeO4K9wbM4gwwPHV1yfoSJquLTUJVXs,1813
|
|
439
439
|
camel/utils/chunker/__init__.py,sha256=6iN6HL6sblIjDuJTILk-9qKcHBZ97t8b6tZCWPZ0OYI,899
|
|
440
440
|
camel/utils/chunker/base.py,sha256=9CuqymFCRncyAdEST-IcRonB732YAPhusznqH-RES3E,960
|
|
441
441
|
camel/utils/chunker/code_chunker.py,sha256=9h4rd39H9ngbOWAjd_12xt-EzVMh0e_fZnC4my8h_Jg,6823
|
|
@@ -446,7 +446,7 @@ camel/verifiers/math_verifier.py,sha256=tA1D4S0sm8nsWISevxSN0hvSVtIUpqmJhzqfbuMo
|
|
|
446
446
|
camel/verifiers/models.py,sha256=GdxYPr7UxNrR1577yW4kyroRcLGfd-H1GXgv8potDWU,2471
|
|
447
447
|
camel/verifiers/physics_verifier.py,sha256=c1grrRddcrVN7szkxhv2QirwY9viIRSITWeWFF5HmLs,30187
|
|
448
448
|
camel/verifiers/python_verifier.py,sha256=ogTz77wODfEcDN4tMVtiSkRQyoiZbHPY2fKybn59lHw,20558
|
|
449
|
-
camel_ai-0.2.
|
|
450
|
-
camel_ai-0.2.
|
|
451
|
-
camel_ai-0.2.
|
|
452
|
-
camel_ai-0.2.
|
|
449
|
+
camel_ai-0.2.72a0.dist-info/METADATA,sha256=JsM9sjR0ozHqZrsduo84JEf-3s9a1M2wALAbhI9Fw-Y,49998
|
|
450
|
+
camel_ai-0.2.72a0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
451
|
+
camel_ai-0.2.72a0.dist-info/licenses/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
|
|
452
|
+
camel_ai-0.2.72a0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|