camel-ai 0.2.73a4__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/_utils.py +38 -0
- camel/agents/chat_agent.py +2217 -519
- camel/agents/mcp_agent.py +30 -27
- 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/data_collectors/alpaca_collector.py +15 -6
- camel/datasets/base_generator.py +39 -10
- 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 +3 -12
- camel/interpreters/e2b_interpreter.py +34 -1
- camel/interpreters/microsandbox_interpreter.py +395 -0
- camel/loaders/__init__.py +11 -2
- camel/loaders/chunkr_reader.py +9 -0
- camel/memories/agent_memories.py +48 -4
- camel/memories/base.py +26 -0
- camel/memories/blocks/chat_history_block.py +122 -4
- camel/memories/context_creators/score_based.py +25 -384
- camel/memories/records.py +88 -8
- camel/messages/base.py +153 -34
- 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 +6 -19
- camel/models/aws_bedrock_model.py +2 -33
- camel/models/azure_openai_model.py +114 -89
- camel/models/base_audio_model.py +3 -1
- camel/models/base_model.py +32 -14
- camel/models/cohere_model.py +1 -16
- camel/models/cometapi_model.py +83 -0
- camel/models/crynux_model.py +1 -16
- camel/models/deepseek_model.py +1 -16
- camel/models/fish_audio_model.py +6 -0
- camel/models/gemini_model.py +36 -18
- camel/models/groq_model.py +1 -17
- camel/models/internlm_model.py +1 -16
- camel/models/litellm_model.py +1 -16
- 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/modelscope_model.py +1 -16
- camel/models/moonshot_model.py +105 -24
- 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 +62 -41
- camel/models/openai_model.py +62 -57
- 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/daytona_runtime.py +11 -12
- camel/societies/__init__.py +2 -0
- camel/societies/workforce/__init__.py +2 -0
- camel/societies/workforce/events.py +122 -0
- camel/societies/workforce/prompts.py +146 -66
- camel/societies/workforce/role_playing_worker.py +15 -11
- camel/societies/workforce/single_agent_worker.py +302 -65
- camel/societies/workforce/structured_output_handler.py +30 -18
- camel/societies/workforce/task_channel.py +163 -27
- camel/societies/workforce/utils.py +107 -13
- camel/societies/workforce/workflow_memory_manager.py +772 -0
- camel/societies/workforce/workforce.py +1949 -579
- camel/societies/workforce/workforce_callback.py +74 -0
- camel/societies/workforce/workforce_logger.py +168 -145
- camel/societies/workforce/workforce_metrics.py +33 -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/oceanbase.py +13 -13
- camel/storages/vectordb_storages/qdrant.py +3 -3
- camel/storages/vectordb_storages/tidb.py +8 -6
- camel/tasks/task.py +4 -3
- camel/toolkits/__init__.py +20 -7
- camel/toolkits/aci_toolkit.py +45 -0
- camel/toolkits/base.py +6 -4
- camel/toolkits/code_execution.py +28 -1
- camel/toolkits/context_summarizer_toolkit.py +684 -0
- camel/toolkits/dappier_toolkit.py +5 -1
- camel/toolkits/dingtalk.py +1135 -0
- camel/toolkits/edgeone_pages_mcp_toolkit.py +11 -31
- camel/toolkits/excel_toolkit.py +1 -1
- camel/toolkits/{file_write_toolkit.py → file_toolkit.py} +430 -36
- camel/toolkits/function_tool.py +13 -3
- camel/toolkits/github_toolkit.py +104 -17
- camel/toolkits/gmail_toolkit.py +1839 -0
- camel/toolkits/google_calendar_toolkit.py +38 -4
- camel/toolkits/google_drive_mcp_toolkit.py +12 -31
- camel/toolkits/hybrid_browser_toolkit/config_loader.py +15 -0
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit.py +77 -8
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit_ts.py +884 -88
- camel/toolkits/hybrid_browser_toolkit/installer.py +203 -0
- camel/toolkits/hybrid_browser_toolkit/ts/package-lock.json +5 -612
- camel/toolkits/hybrid_browser_toolkit/ts/package.json +0 -1
- camel/toolkits/hybrid_browser_toolkit/ts/src/browser-session.ts +959 -89
- camel/toolkits/hybrid_browser_toolkit/ts/src/config-loader.ts +9 -2
- camel/toolkits/hybrid_browser_toolkit/ts/src/hybrid-browser-toolkit.ts +281 -213
- 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 +23 -3
- camel/toolkits/hybrid_browser_toolkit/ts/websocket-server.js +72 -7
- camel/toolkits/hybrid_browser_toolkit/ws_wrapper.py +582 -132
- camel/toolkits/hybrid_browser_toolkit_py/actions.py +158 -0
- camel/toolkits/hybrid_browser_toolkit_py/browser_session.py +55 -8
- camel/toolkits/hybrid_browser_toolkit_py/config_loader.py +43 -0
- camel/toolkits/hybrid_browser_toolkit_py/hybrid_browser_toolkit.py +321 -8
- camel/toolkits/hybrid_browser_toolkit_py/snapshot.py +10 -4
- camel/toolkits/hybrid_browser_toolkit_py/unified_analyzer.js +45 -4
- camel/toolkits/{openai_image_toolkit.py → image_generation_toolkit.py} +151 -53
- camel/toolkits/klavis_toolkit.py +5 -1
- camel/toolkits/markitdown_toolkit.py +27 -1
- camel/toolkits/math_toolkit.py +64 -10
- camel/toolkits/mcp_toolkit.py +366 -71
- camel/toolkits/memory_toolkit.py +5 -1
- camel/toolkits/message_integration.py +18 -13
- camel/toolkits/minimax_mcp_toolkit.py +195 -0
- camel/toolkits/note_taking_toolkit.py +19 -10
- camel/toolkits/notion_mcp_toolkit.py +16 -26
- camel/toolkits/openbb_toolkit.py +5 -1
- camel/toolkits/origene_mcp_toolkit.py +8 -49
- camel/toolkits/playwright_mcp_toolkit.py +12 -31
- camel/toolkits/resend_toolkit.py +168 -0
- camel/toolkits/search_toolkit.py +264 -91
- camel/toolkits/slack_toolkit.py +64 -10
- 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/vertex_ai_veo_toolkit.py +590 -0
- camel/toolkits/video_analysis_toolkit.py +17 -11
- camel/toolkits/wechat_official_toolkit.py +483 -0
- camel/toolkits/zapier_toolkit.py +5 -1
- camel/types/__init__.py +2 -2
- camel/types/enums.py +274 -7
- camel/types/openai_types.py +2 -2
- camel/types/unified_model_type.py +15 -0
- 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/token_counting.py +43 -20
- {camel_ai-0.2.73a4.dist-info → camel_ai-0.2.80a2.dist-info}/METADATA +223 -83
- {camel_ai-0.2.73a4.dist-info → camel_ai-0.2.80a2.dist-info}/RECORD +170 -141
- camel/loaders/pandas_reader.py +0 -368
- camel/toolkits/openai_agent_toolkit.py +0 -135
- camel/toolkits/terminal_toolkit.py +0 -1550
- {camel_ai-0.2.73a4.dist-info → camel_ai-0.2.80a2.dist-info}/WHEEL +0 -0
- {camel_ai-0.2.73a4.dist-info → camel_ai-0.2.80a2.dist-info}/licenses/LICENSE +0 -0
|
@@ -141,9 +141,13 @@ class WebSocketBrowserServer {
|
|
|
141
141
|
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
142
142
|
return await this.toolkit.getPageSnapshot(params.viewport_limit);
|
|
143
143
|
|
|
144
|
-
case 'get_snapshot_for_ai':
|
|
144
|
+
case 'get_snapshot_for_ai': {
|
|
145
145
|
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
146
|
-
|
|
146
|
+
// Support includeCoordinates and viewportLimit parameters
|
|
147
|
+
const includeCoordinates = Boolean(params.includeCoordinates);
|
|
148
|
+
const viewportLimit = Boolean(params.viewportLimit);
|
|
149
|
+
return await this.toolkit.session.getSnapshotForAI(includeCoordinates, viewportLimit);
|
|
150
|
+
}
|
|
147
151
|
|
|
148
152
|
case 'get_som_screenshot': {
|
|
149
153
|
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
@@ -160,7 +164,14 @@ class WebSocketBrowserServer {
|
|
|
160
164
|
|
|
161
165
|
case 'type':
|
|
162
166
|
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
163
|
-
|
|
167
|
+
// Handle both single input and multiple inputs
|
|
168
|
+
if (params.inputs) {
|
|
169
|
+
// Multiple inputs mode - pass inputs array directly
|
|
170
|
+
return await this.toolkit.type(params.inputs);
|
|
171
|
+
} else {
|
|
172
|
+
// Single input mode - pass ref and text
|
|
173
|
+
return await this.toolkit.type(params.ref, params.text);
|
|
174
|
+
}
|
|
164
175
|
|
|
165
176
|
case 'select':
|
|
166
177
|
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
@@ -173,6 +184,23 @@ class WebSocketBrowserServer {
|
|
|
173
184
|
case 'enter':
|
|
174
185
|
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
175
186
|
return await this.toolkit.enter();
|
|
187
|
+
|
|
188
|
+
case 'mouse_control':
|
|
189
|
+
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
190
|
+
return await this.toolkit.mouseControl(params.control, params.x, params.y);
|
|
191
|
+
|
|
192
|
+
case 'mouse_drag':
|
|
193
|
+
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
194
|
+
return await this.toolkit.mouseDrag(params.from_ref, params.to_ref);
|
|
195
|
+
|
|
196
|
+
case 'press_key':
|
|
197
|
+
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
198
|
+
return await this.toolkit.pressKeys(params.keys);
|
|
199
|
+
|
|
200
|
+
case 'batch_keyboard_input':
|
|
201
|
+
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
202
|
+
const skipStabilityWait = params.skipStabilityWait !== undefined ? params.skipStabilityWait : true;
|
|
203
|
+
return await this.toolkit.batchKeyboardInput(params.operations, skipStabilityWait);
|
|
176
204
|
|
|
177
205
|
case 'back':
|
|
178
206
|
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
@@ -194,12 +222,22 @@ class WebSocketBrowserServer {
|
|
|
194
222
|
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
195
223
|
return await this.toolkit.getTabInfo();
|
|
196
224
|
|
|
225
|
+
case 'console_view':
|
|
226
|
+
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
227
|
+
return await this.toolkit.getConsoleView();
|
|
228
|
+
|
|
229
|
+
case 'console_exec':
|
|
230
|
+
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
231
|
+
return await this.toolkit.consoleExecute(params.code);
|
|
232
|
+
|
|
197
233
|
case 'wait_user':
|
|
198
234
|
if (!this.toolkit) throw new Error('Toolkit not initialized');
|
|
199
235
|
return await this.toolkit.waitUser(params.timeout);
|
|
200
236
|
|
|
201
|
-
case 'shutdown':
|
|
237
|
+
case 'shutdown': {
|
|
202
238
|
console.log('Shutting down server...');
|
|
239
|
+
|
|
240
|
+
// Close browser first
|
|
203
241
|
if (this.toolkit) {
|
|
204
242
|
try {
|
|
205
243
|
await this.toolkit.closeBrowser();
|
|
@@ -207,10 +245,37 @@ class WebSocketBrowserServer {
|
|
|
207
245
|
console.error('Error closing browser:', error);
|
|
208
246
|
}
|
|
209
247
|
}
|
|
248
|
+
|
|
249
|
+
// Return response immediately
|
|
250
|
+
const shutdownResponse = { message: 'Server shutting down' };
|
|
251
|
+
|
|
252
|
+
// Schedule server shutdown after a short delay to ensure response is sent
|
|
210
253
|
setTimeout(() => {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
254
|
+
// Close the WebSocket server properly
|
|
255
|
+
if (this.server) {
|
|
256
|
+
this.server.close((err) => {
|
|
257
|
+
if (err) {
|
|
258
|
+
console.error('Error closing server:', err);
|
|
259
|
+
} else {
|
|
260
|
+
console.log('WebSocket server closed successfully');
|
|
261
|
+
}
|
|
262
|
+
console.log('Exiting process...');
|
|
263
|
+
process.exit(0);
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
// Fallback timeout in case server close hangs
|
|
267
|
+
setTimeout(() => {
|
|
268
|
+
console.log('Server close timeout, forcing exit...');
|
|
269
|
+
process.exit(0);
|
|
270
|
+
}, 5000); // 5 second fallback
|
|
271
|
+
} else {
|
|
272
|
+
console.log('No server to close, exiting...');
|
|
273
|
+
process.exit(0);
|
|
274
|
+
}
|
|
275
|
+
}, 100); // Delay to ensure response is sent
|
|
276
|
+
|
|
277
|
+
return shutdownResponse;
|
|
278
|
+
}
|
|
214
279
|
|
|
215
280
|
default:
|
|
216
281
|
throw new Error(`Unknown command: ${command}`);
|