camel-ai 0.2.67__py3-none-any.whl → 0.2.80a2__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.
- camel/__init__.py +1 -1
- camel/agents/_types.py +6 -2
- camel/agents/_utils.py +38 -0
- camel/agents/chat_agent.py +4014 -410
- camel/agents/mcp_agent.py +30 -27
- camel/agents/repo_agent.py +2 -1
- camel/benchmarks/browsecomp.py +6 -6
- camel/configs/__init__.py +15 -0
- camel/configs/aihubmix_config.py +88 -0
- camel/configs/amd_config.py +70 -0
- camel/configs/cometapi_config.py +104 -0
- camel/configs/minimax_config.py +93 -0
- camel/configs/nebius_config.py +103 -0
- camel/configs/vllm_config.py +2 -0
- camel/data_collectors/alpaca_collector.py +15 -6
- camel/datagen/self_improving_cot.py +1 -1
- camel/datasets/base_generator.py +39 -10
- camel/environments/__init__.py +12 -0
- camel/environments/rlcards_env.py +860 -0
- camel/environments/single_step.py +28 -3
- camel/environments/tic_tac_toe.py +1 -1
- camel/interpreters/__init__.py +2 -0
- camel/interpreters/docker/Dockerfile +4 -16
- camel/interpreters/docker_interpreter.py +3 -2
- camel/interpreters/e2b_interpreter.py +34 -1
- camel/interpreters/internal_python_interpreter.py +51 -2
- camel/interpreters/microsandbox_interpreter.py +395 -0
- camel/loaders/__init__.py +11 -2
- camel/loaders/base_loader.py +85 -0
- camel/loaders/chunkr_reader.py +9 -0
- camel/loaders/firecrawl_reader.py +4 -4
- camel/logger.py +1 -1
- camel/memories/agent_memories.py +84 -1
- camel/memories/base.py +34 -0
- camel/memories/blocks/chat_history_block.py +122 -4
- camel/memories/blocks/vectordb_block.py +8 -1
- camel/memories/context_creators/score_based.py +29 -237
- camel/memories/records.py +88 -8
- camel/messages/base.py +166 -40
- camel/messages/func_message.py +32 -5
- camel/models/__init__.py +10 -0
- camel/models/aihubmix_model.py +83 -0
- camel/models/aiml_model.py +1 -16
- camel/models/amd_model.py +101 -0
- camel/models/anthropic_model.py +117 -18
- camel/models/aws_bedrock_model.py +2 -33
- camel/models/azure_openai_model.py +205 -91
- camel/models/base_audio_model.py +3 -1
- camel/models/base_model.py +189 -24
- camel/models/cohere_model.py +5 -17
- camel/models/cometapi_model.py +83 -0
- camel/models/crynux_model.py +1 -16
- camel/models/deepseek_model.py +6 -16
- camel/models/fish_audio_model.py +6 -0
- camel/models/gemini_model.py +71 -20
- camel/models/groq_model.py +1 -17
- camel/models/internlm_model.py +1 -16
- camel/models/litellm_model.py +49 -32
- camel/models/lmstudio_model.py +1 -17
- camel/models/minimax_model.py +83 -0
- camel/models/mistral_model.py +1 -16
- camel/models/model_factory.py +27 -1
- camel/models/model_manager.py +24 -6
- camel/models/modelscope_model.py +1 -16
- camel/models/moonshot_model.py +185 -19
- camel/models/nebius_model.py +83 -0
- camel/models/nemotron_model.py +0 -5
- camel/models/netmind_model.py +1 -16
- camel/models/novita_model.py +1 -16
- camel/models/nvidia_model.py +1 -16
- camel/models/ollama_model.py +4 -19
- camel/models/openai_compatible_model.py +171 -46
- camel/models/openai_model.py +205 -77
- camel/models/openrouter_model.py +1 -17
- camel/models/ppio_model.py +1 -16
- camel/models/qianfan_model.py +1 -16
- camel/models/qwen_model.py +1 -16
- camel/models/reka_model.py +1 -16
- camel/models/samba_model.py +34 -47
- camel/models/sglang_model.py +64 -31
- camel/models/siliconflow_model.py +1 -16
- camel/models/stub_model.py +0 -4
- camel/models/togetherai_model.py +1 -16
- camel/models/vllm_model.py +1 -16
- camel/models/volcano_model.py +0 -17
- camel/models/watsonx_model.py +1 -16
- camel/models/yi_model.py +1 -16
- camel/models/zhipuai_model.py +60 -16
- camel/parsers/__init__.py +18 -0
- camel/parsers/mcp_tool_call_parser.py +176 -0
- camel/retrievers/auto_retriever.py +1 -0
- camel/runtimes/configs.py +11 -11
- camel/runtimes/daytona_runtime.py +15 -16
- camel/runtimes/docker_runtime.py +6 -6
- camel/runtimes/remote_http_runtime.py +5 -5
- camel/services/agent_openapi_server.py +380 -0
- camel/societies/__init__.py +2 -0
- camel/societies/role_playing.py +26 -28
- camel/societies/workforce/__init__.py +2 -0
- camel/societies/workforce/events.py +122 -0
- camel/societies/workforce/prompts.py +249 -38
- camel/societies/workforce/role_playing_worker.py +82 -20
- camel/societies/workforce/single_agent_worker.py +634 -34
- camel/societies/workforce/structured_output_handler.py +512 -0
- camel/societies/workforce/task_channel.py +169 -23
- camel/societies/workforce/utils.py +176 -9
- camel/societies/workforce/worker.py +77 -23
- camel/societies/workforce/workflow_memory_manager.py +772 -0
- camel/societies/workforce/workforce.py +3168 -478
- camel/societies/workforce/workforce_callback.py +74 -0
- camel/societies/workforce/workforce_logger.py +203 -175
- camel/societies/workforce/workforce_metrics.py +33 -0
- camel/storages/__init__.py +4 -0
- camel/storages/key_value_storages/json.py +15 -2
- camel/storages/key_value_storages/mem0_cloud.py +48 -47
- camel/storages/object_storages/google_cloud.py +1 -1
- camel/storages/vectordb_storages/__init__.py +6 -0
- camel/storages/vectordb_storages/chroma.py +731 -0
- camel/storages/vectordb_storages/oceanbase.py +13 -13
- camel/storages/vectordb_storages/pgvector.py +349 -0
- camel/storages/vectordb_storages/qdrant.py +3 -3
- camel/storages/vectordb_storages/surreal.py +365 -0
- camel/storages/vectordb_storages/tidb.py +8 -6
- camel/tasks/task.py +244 -27
- camel/toolkits/__init__.py +46 -8
- camel/toolkits/aci_toolkit.py +64 -19
- camel/toolkits/arxiv_toolkit.py +6 -6
- camel/toolkits/base.py +63 -5
- camel/toolkits/code_execution.py +28 -1
- camel/toolkits/context_summarizer_toolkit.py +684 -0
- camel/toolkits/craw4ai_toolkit.py +93 -0
- camel/toolkits/dappier_toolkit.py +10 -6
- camel/toolkits/dingtalk.py +1135 -0
- camel/toolkits/edgeone_pages_mcp_toolkit.py +49 -0
- camel/toolkits/excel_toolkit.py +901 -67
- camel/toolkits/file_toolkit.py +1402 -0
- camel/toolkits/function_tool.py +30 -6
- camel/toolkits/github_toolkit.py +107 -20
- camel/toolkits/gmail_toolkit.py +1839 -0
- camel/toolkits/google_calendar_toolkit.py +38 -4
- camel/toolkits/google_drive_mcp_toolkit.py +54 -0
- camel/toolkits/human_toolkit.py +34 -10
- camel/toolkits/hybrid_browser_toolkit/__init__.py +18 -0
- camel/toolkits/hybrid_browser_toolkit/config_loader.py +185 -0
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit.py +246 -0
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit_ts.py +1973 -0
- camel/toolkits/hybrid_browser_toolkit/installer.py +203 -0
- camel/toolkits/hybrid_browser_toolkit/ts/package-lock.json +3749 -0
- camel/toolkits/hybrid_browser_toolkit/ts/package.json +32 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/browser-scripts.js +125 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/browser-session.ts +1815 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/config-loader.ts +233 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/hybrid-browser-toolkit.ts +590 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/index.ts +7 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/parent-child-filter.ts +226 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/snapshot-parser.ts +219 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/som-screenshot-injected.ts +543 -0
- camel/toolkits/hybrid_browser_toolkit/ts/src/types.ts +130 -0
- camel/toolkits/hybrid_browser_toolkit/ts/tsconfig.json +26 -0
- camel/toolkits/hybrid_browser_toolkit/ts/websocket-server.js +319 -0
- camel/toolkits/hybrid_browser_toolkit/ws_wrapper.py +1032 -0
- camel/toolkits/hybrid_browser_toolkit_py/__init__.py +17 -0
- camel/toolkits/hybrid_browser_toolkit_py/actions.py +575 -0
- camel/toolkits/hybrid_browser_toolkit_py/agent.py +311 -0
- camel/toolkits/hybrid_browser_toolkit_py/browser_session.py +787 -0
- camel/toolkits/hybrid_browser_toolkit_py/config_loader.py +490 -0
- camel/toolkits/hybrid_browser_toolkit_py/hybrid_browser_toolkit.py +2390 -0
- camel/toolkits/hybrid_browser_toolkit_py/snapshot.py +233 -0
- camel/toolkits/hybrid_browser_toolkit_py/stealth_script.js +0 -0
- camel/toolkits/hybrid_browser_toolkit_py/unified_analyzer.js +1043 -0
- camel/toolkits/image_generation_toolkit.py +390 -0
- camel/toolkits/jina_reranker_toolkit.py +3 -4
- camel/toolkits/klavis_toolkit.py +5 -1
- camel/toolkits/markitdown_toolkit.py +104 -0
- camel/toolkits/math_toolkit.py +64 -10
- camel/toolkits/mcp_toolkit.py +370 -45
- camel/toolkits/memory_toolkit.py +5 -1
- camel/toolkits/message_agent_toolkit.py +608 -0
- camel/toolkits/message_integration.py +724 -0
- camel/toolkits/minimax_mcp_toolkit.py +195 -0
- camel/toolkits/note_taking_toolkit.py +277 -0
- camel/toolkits/notion_mcp_toolkit.py +224 -0
- camel/toolkits/openbb_toolkit.py +5 -1
- camel/toolkits/origene_mcp_toolkit.py +56 -0
- camel/toolkits/playwright_mcp_toolkit.py +12 -31
- camel/toolkits/pptx_toolkit.py +25 -12
- camel/toolkits/resend_toolkit.py +168 -0
- camel/toolkits/screenshot_toolkit.py +213 -0
- camel/toolkits/search_toolkit.py +437 -142
- camel/toolkits/slack_toolkit.py +104 -50
- camel/toolkits/sympy_toolkit.py +1 -1
- camel/toolkits/task_planning_toolkit.py +3 -3
- camel/toolkits/terminal_toolkit/__init__.py +18 -0
- camel/toolkits/terminal_toolkit/terminal_toolkit.py +957 -0
- camel/toolkits/terminal_toolkit/utils.py +532 -0
- camel/toolkits/thinking_toolkit.py +1 -1
- camel/toolkits/vertex_ai_veo_toolkit.py +590 -0
- camel/toolkits/video_analysis_toolkit.py +106 -26
- camel/toolkits/video_download_toolkit.py +17 -14
- camel/toolkits/web_deploy_toolkit.py +1219 -0
- camel/toolkits/wechat_official_toolkit.py +483 -0
- camel/toolkits/zapier_toolkit.py +5 -1
- camel/types/__init__.py +2 -2
- camel/types/agents/tool_calling_record.py +4 -1
- camel/types/enums.py +316 -40
- camel/types/openai_types.py +2 -2
- camel/types/unified_model_type.py +31 -4
- camel/utils/commons.py +36 -5
- camel/utils/constants.py +3 -0
- camel/utils/context_utils.py +1003 -0
- camel/utils/mcp.py +138 -4
- camel/utils/mcp_client.py +45 -1
- camel/utils/message_summarizer.py +148 -0
- camel/utils/token_counting.py +43 -20
- camel/utils/tool_result.py +44 -0
- {camel_ai-0.2.67.dist-info → camel_ai-0.2.80a2.dist-info}/METADATA +296 -85
- {camel_ai-0.2.67.dist-info → camel_ai-0.2.80a2.dist-info}/RECORD +219 -146
- camel/loaders/pandas_reader.py +0 -368
- camel/toolkits/dalle_toolkit.py +0 -175
- camel/toolkits/file_write_toolkit.py +0 -444
- camel/toolkits/openai_agent_toolkit.py +0 -135
- camel/toolkits/terminal_toolkit.py +0 -1037
- {camel_ai-0.2.67.dist-info → camel_ai-0.2.80a2.dist-info}/WHEEL +0 -0
- {camel_ai-0.2.67.dist-info → camel_ai-0.2.80a2.dist-info}/licenses/LICENSE +0 -0
camel/toolkits/slack_toolkit.py
CHANGED
|
@@ -128,18 +128,15 @@ class SlackToolkit(BaseToolkit):
|
|
|
128
128
|
return f"Error creating conversation: {e.response['error']}"
|
|
129
129
|
|
|
130
130
|
def join_slack_channel(self, channel_id: str) -> str:
|
|
131
|
-
r"""Joins an existing Slack channel.
|
|
131
|
+
r"""Joins an existing Slack channel. When use this function you must
|
|
132
|
+
call `get_slack_channel_information` function first to get the
|
|
133
|
+
`channel id`.
|
|
132
134
|
|
|
133
135
|
Args:
|
|
134
136
|
channel_id (str): The ID of the Slack channel to join.
|
|
135
137
|
|
|
136
138
|
Returns:
|
|
137
|
-
str: A
|
|
138
|
-
or an error message.
|
|
139
|
-
|
|
140
|
-
Raises:
|
|
141
|
-
SlackApiError: If there is an error during get slack channel
|
|
142
|
-
information.
|
|
139
|
+
str: A string containing the API response from Slack.
|
|
143
140
|
"""
|
|
144
141
|
from slack_sdk.errors import SlackApiError
|
|
145
142
|
|
|
@@ -148,21 +145,18 @@ class SlackToolkit(BaseToolkit):
|
|
|
148
145
|
response = slack_client.conversations_join(channel=channel_id)
|
|
149
146
|
return str(response)
|
|
150
147
|
except SlackApiError as e:
|
|
151
|
-
return f"Error
|
|
148
|
+
return f"Error joining channel: {e.response['error']}"
|
|
152
149
|
|
|
153
150
|
def leave_slack_channel(self, channel_id: str) -> str:
|
|
154
|
-
r"""Leaves an existing Slack channel.
|
|
151
|
+
r"""Leaves an existing Slack channel. When use this function you must
|
|
152
|
+
call `get_slack_channel_information` function first to get the
|
|
153
|
+
`channel id`.
|
|
155
154
|
|
|
156
155
|
Args:
|
|
157
156
|
channel_id (str): The ID of the Slack channel to leave.
|
|
158
157
|
|
|
159
158
|
Returns:
|
|
160
|
-
str: A
|
|
161
|
-
or an error message.
|
|
162
|
-
|
|
163
|
-
Raises:
|
|
164
|
-
SlackApiError: If there is an error during get slack channel
|
|
165
|
-
information.
|
|
159
|
+
str: A string containing the API response from Slack.
|
|
166
160
|
"""
|
|
167
161
|
from slack_sdk.errors import SlackApiError
|
|
168
162
|
|
|
@@ -171,18 +165,18 @@ class SlackToolkit(BaseToolkit):
|
|
|
171
165
|
response = slack_client.conversations_leave(channel=channel_id)
|
|
172
166
|
return str(response)
|
|
173
167
|
except SlackApiError as e:
|
|
174
|
-
return f"Error
|
|
168
|
+
return f"Error leaving channel: {e.response['error']}"
|
|
175
169
|
|
|
176
170
|
def get_slack_channel_information(self) -> str:
|
|
177
|
-
r"""Retrieve
|
|
178
|
-
format.
|
|
171
|
+
r"""Retrieve a list of all public channels in the Slack workspace.
|
|
179
172
|
|
|
180
|
-
|
|
181
|
-
|
|
173
|
+
This function is crucial for discovering available channels and their
|
|
174
|
+
`channel_id`s, which are required by many other functions.
|
|
182
175
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
176
|
+
Returns:
|
|
177
|
+
str: A JSON string representing a list of channels. Each channel
|
|
178
|
+
object in the list contains 'id', 'name', 'created', and
|
|
179
|
+
'num_members'. Returns an error message string on failure.
|
|
186
180
|
"""
|
|
187
181
|
from slack_sdk.errors import SlackApiError
|
|
188
182
|
|
|
@@ -204,21 +198,20 @@ class SlackToolkit(BaseToolkit):
|
|
|
204
198
|
]
|
|
205
199
|
return json.dumps(filtered_result, ensure_ascii=False)
|
|
206
200
|
except SlackApiError as e:
|
|
207
|
-
return f"Error
|
|
201
|
+
return f"Error retrieving channel list: {e.response['error']}"
|
|
208
202
|
|
|
209
203
|
def get_slack_channel_message(self, channel_id: str) -> str:
|
|
210
|
-
r"""Retrieve messages from a Slack channel.
|
|
204
|
+
r"""Retrieve messages from a Slack channel. When use this function you
|
|
205
|
+
must call `get_slack_channel_information` function first to get the
|
|
206
|
+
`channel id`.
|
|
211
207
|
|
|
212
208
|
Args:
|
|
213
209
|
channel_id (str): The ID of the Slack channel to retrieve messages
|
|
214
210
|
from.
|
|
215
211
|
|
|
216
212
|
Returns:
|
|
217
|
-
str: JSON string
|
|
218
|
-
|
|
219
|
-
Raises:
|
|
220
|
-
SlackApiError: If there is an error during get
|
|
221
|
-
slack channel message.
|
|
213
|
+
str: A JSON string representing a list of messages. Each message
|
|
214
|
+
object contains 'user', 'text', and 'ts' (timestamp).
|
|
222
215
|
"""
|
|
223
216
|
from slack_sdk.errors import SlackApiError
|
|
224
217
|
|
|
@@ -239,27 +232,37 @@ class SlackToolkit(BaseToolkit):
|
|
|
239
232
|
self,
|
|
240
233
|
message: str,
|
|
241
234
|
channel_id: str,
|
|
235
|
+
file_path: Optional[str] = None,
|
|
242
236
|
user: Optional[str] = None,
|
|
243
237
|
) -> str:
|
|
244
|
-
r"""Send a message to a Slack channel.
|
|
238
|
+
r"""Send a message to a Slack channel. When use this function you must
|
|
239
|
+
call `get_slack_channel_information` function first to get the
|
|
240
|
+
`channel id`. If use user, you must use `get_slack_user_list`
|
|
241
|
+
function first to get the user id.
|
|
245
242
|
|
|
246
243
|
Args:
|
|
247
244
|
message (str): The message to send.
|
|
248
|
-
channel_id (str): The ID of the
|
|
249
|
-
|
|
250
|
-
|
|
245
|
+
channel_id (str): The ID of the channel to send the message to.
|
|
246
|
+
file_path (Optional[str]): The local path of a file to upload
|
|
247
|
+
with the message.
|
|
248
|
+
user (Optional[str]): The ID of a user to send an ephemeral
|
|
249
|
+
message to (visible only to that user).
|
|
251
250
|
|
|
252
251
|
Returns:
|
|
253
|
-
str: A confirmation message indicating
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
Raises:
|
|
257
|
-
SlackApiError: If an error occurs while sending the message.
|
|
252
|
+
str: A confirmation message indicating success or an error
|
|
253
|
+
message.
|
|
258
254
|
"""
|
|
259
255
|
from slack_sdk.errors import SlackApiError
|
|
260
256
|
|
|
261
257
|
try:
|
|
262
258
|
slack_client = self._login_slack()
|
|
259
|
+
if file_path:
|
|
260
|
+
response = slack_client.files_upload_v2(
|
|
261
|
+
channel=channel_id,
|
|
262
|
+
file=file_path,
|
|
263
|
+
initial_comment=message,
|
|
264
|
+
)
|
|
265
|
+
return f"File sent successfully, got response: {response}"
|
|
263
266
|
if user:
|
|
264
267
|
response = slack_client.chat_postEphemeral(
|
|
265
268
|
channel=channel_id, text=message, user=user
|
|
@@ -268,27 +271,30 @@ class SlackToolkit(BaseToolkit):
|
|
|
268
271
|
response = slack_client.chat_postMessage(
|
|
269
272
|
channel=channel_id, text=message
|
|
270
273
|
)
|
|
271
|
-
return
|
|
274
|
+
return (
|
|
275
|
+
f"Message: {message} sent successfully, "
|
|
276
|
+
f"got response: {response}"
|
|
277
|
+
)
|
|
272
278
|
except SlackApiError as e:
|
|
273
|
-
return f"Error
|
|
279
|
+
return f"Error sending message: {e.response['error']}"
|
|
274
280
|
|
|
275
281
|
def delete_slack_message(
|
|
276
282
|
self,
|
|
277
283
|
time_stamp: str,
|
|
278
284
|
channel_id: str,
|
|
279
285
|
) -> str:
|
|
280
|
-
r"""Delete a message
|
|
286
|
+
r"""Delete a message from a Slack channel. When use this function you
|
|
287
|
+
must call `get_slack_channel_information` function first to get the
|
|
288
|
+
`channel id`.
|
|
281
289
|
|
|
282
290
|
Args:
|
|
283
|
-
time_stamp (str):
|
|
284
|
-
|
|
291
|
+
time_stamp (str): The 'ts' value of the message to be deleted.
|
|
292
|
+
You can get this from the `get_slack_channel_message` function.
|
|
293
|
+
channel_id (str): The ID of the channel where the message is. Use
|
|
294
|
+
`get_slack_channel_information` to find the `channel_id`.
|
|
285
295
|
|
|
286
296
|
Returns:
|
|
287
|
-
str: A
|
|
288
|
-
was delete successfully or an error message.
|
|
289
|
-
|
|
290
|
-
Raises:
|
|
291
|
-
SlackApiError: If an error occurs while sending the message.
|
|
297
|
+
str: A string containing the API response from Slack.
|
|
292
298
|
"""
|
|
293
299
|
from slack_sdk.errors import SlackApiError
|
|
294
300
|
|
|
@@ -299,7 +305,53 @@ class SlackToolkit(BaseToolkit):
|
|
|
299
305
|
)
|
|
300
306
|
return str(response)
|
|
301
307
|
except SlackApiError as e:
|
|
302
|
-
return f"Error
|
|
308
|
+
return f"Error deleting message: {e.response['error']}"
|
|
309
|
+
|
|
310
|
+
def get_slack_user_list(self) -> str:
|
|
311
|
+
r"""Retrieve a list of all users in the Slack workspace.
|
|
312
|
+
|
|
313
|
+
Returns:
|
|
314
|
+
str: A JSON string representing a list of users. Each user
|
|
315
|
+
object contains 'id', 'name'.
|
|
316
|
+
"""
|
|
317
|
+
from slack_sdk.errors import SlackApiError
|
|
318
|
+
|
|
319
|
+
try:
|
|
320
|
+
slack_client = self._login_slack()
|
|
321
|
+
response = slack_client.users_list()
|
|
322
|
+
users = response["members"]
|
|
323
|
+
filtered_users = [
|
|
324
|
+
{
|
|
325
|
+
"id": user["id"],
|
|
326
|
+
"name": user["name"],
|
|
327
|
+
}
|
|
328
|
+
for user in users
|
|
329
|
+
]
|
|
330
|
+
|
|
331
|
+
return json.dumps(filtered_users, ensure_ascii=False)
|
|
332
|
+
except SlackApiError as e:
|
|
333
|
+
return f"Error retrieving user list: {e.response['error']}"
|
|
334
|
+
|
|
335
|
+
def get_slack_user_info(self, user_id: str) -> str:
|
|
336
|
+
r"""Retrieve information about a specific user in the Slack workspace.
|
|
337
|
+
normally, you don't need to use this method, when you need to get a
|
|
338
|
+
user's detailed information, use this method. Use `get_slack_user_list`
|
|
339
|
+
function first to get the user id.
|
|
340
|
+
|
|
341
|
+
Args:
|
|
342
|
+
user_id (str): The ID of the user to retrieve information about.
|
|
343
|
+
|
|
344
|
+
Returns:
|
|
345
|
+
str: A JSON string representing the user's information.
|
|
346
|
+
"""
|
|
347
|
+
from slack_sdk.errors import SlackApiError
|
|
348
|
+
|
|
349
|
+
try:
|
|
350
|
+
slack_client = self._login_slack()
|
|
351
|
+
response = slack_client.users_info(user=user_id)
|
|
352
|
+
return json.dumps(response, ensure_ascii=False)
|
|
353
|
+
except SlackApiError as e:
|
|
354
|
+
return f"Error retrieving user info: {e.response['error']}"
|
|
303
355
|
|
|
304
356
|
def get_tools(self) -> List[FunctionTool]:
|
|
305
357
|
r"""Returns a list of FunctionTool objects representing the
|
|
@@ -317,4 +369,6 @@ class SlackToolkit(BaseToolkit):
|
|
|
317
369
|
FunctionTool(self.get_slack_channel_message),
|
|
318
370
|
FunctionTool(self.send_slack_message),
|
|
319
371
|
FunctionTool(self.delete_slack_message),
|
|
372
|
+
FunctionTool(self.get_slack_user_list),
|
|
373
|
+
FunctionTool(self.get_slack_user_info),
|
|
320
374
|
]
|
camel/toolkits/sympy_toolkit.py
CHANGED
|
@@ -32,7 +32,7 @@ class TaskPlanningToolkit(BaseToolkit):
|
|
|
32
32
|
|
|
33
33
|
Args:
|
|
34
34
|
timeout (Optional[float]): The timeout for the toolkit.
|
|
35
|
-
(default: :obj
|
|
35
|
+
(default: :obj:`None`)
|
|
36
36
|
"""
|
|
37
37
|
super().__init__(timeout=timeout)
|
|
38
38
|
|
|
@@ -53,7 +53,7 @@ class TaskPlanningToolkit(BaseToolkit):
|
|
|
53
53
|
string is the content for a new sub-task.
|
|
54
54
|
original_task_id (Optional[str]): The id of the task to be
|
|
55
55
|
decomposed. If not provided, a new id will be generated.
|
|
56
|
-
(default: :obj
|
|
56
|
+
(default: :obj:`None`)
|
|
57
57
|
|
|
58
58
|
Returns:
|
|
59
59
|
List[Task]: A list of newly created sub-task objects.
|
|
@@ -99,7 +99,7 @@ class TaskPlanningToolkit(BaseToolkit):
|
|
|
99
99
|
sub_task_contents (List[str]): A list of strings, where each
|
|
100
100
|
string is the content for a new sub-task.
|
|
101
101
|
original_task_id (Optional[str]): The id of the task to be
|
|
102
|
-
decomposed. (default: :obj
|
|
102
|
+
decomposed. (default: :obj:`None`)
|
|
103
103
|
|
|
104
104
|
Returns:
|
|
105
105
|
List[Task]: Reordered or modified tasks.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
# you may not use this file except in compliance with the License.
|
|
4
|
+
# You may obtain a copy of the License at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
# See the License for the specific language governing permissions and
|
|
12
|
+
# limitations under the License.
|
|
13
|
+
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
|
+
from .terminal_toolkit import TerminalToolkit
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"TerminalToolkit",
|
|
18
|
+
]
|