From f132ea932a8f9dd35d7243d112a0ed3a931ee876 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 18 Nov 2024 11:25:00 -0800 Subject: [PATCH] [README] --- README.md | 15 +++++++ swarms/tools/e2b_tool.py | 91 ---------------------------------------- 2 files changed, 15 insertions(+), 91 deletions(-) delete mode 100644 swarms/tools/e2b_tool.py diff --git a/README.md b/README.md index dd9ce311..4397eb61 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,21 @@ Swarms is an enterprise grade and production ready multi-agent collaboration framework that enables you to orchestrate many agents to work collaboratively at scale to automate real-world activities. +## ✨ Feature Comparison + +| Category | Features | Benefits | +|----------|----------|-----------| +| 🏢 Enterprise Architecture | • Production-Ready Infrastructure
• High Reliability Systems
• Modular Design
• Comprehensive Logging | • Reduced downtime
• Easier maintenance
• Better debugging
• Enhanced monitoring | +| 🤖 Agent Orchestration | • Hierarchical Swarms
• Parallel Processing
• Sequential Workflows
• Graph-based Workflows
• Dynamic Agent Rearrangement | • Complex task handling
• Improved performance
• Flexible workflows
• Optimized execution | +| 🔄 Integration Capabilities | • Multi-Model Support
• Custom Agent Creation
• Extensive Tool Library
• Multiple Memory Systems | • Provider flexibility
• Custom solutions
• Extended functionality
• Enhanced memory management | +| 📈 Scalability | • Concurrent Processing
• Resource Management
• Load Balancing
• Horizontal Scaling | • Higher throughput
• Efficient resource use
• Better performance
• Easy scaling | +| 🛠️ Developer Tools | • Simple API
• Extensive Documentation
• Active Community
• CLI Tools | • Faster development
• Easy learning curve
• Community support
• Quick deployment | +| 🔐 Security Features | • Error Handling
• Rate Limiting
• Monitoring Integration
• Audit Logging | • Improved reliability
• API protection
• Better monitoring
• Enhanced tracking | +| 📊 Advanced Features | • SpreadsheetSwarm
• Group Chat
• Agent Registry
• Mixture of Agents | • Mass agent management
• Collaborative AI
• Centralized control
• Complex solutions | +| 🔌 Provider Support | • OpenAI
• Anthropic
• ChromaDB
• Custom Providers | • Provider flexibility
• Storage options
• Custom integration
• Vendor independence | +| 💪 Production Features | • Automatic Retries
• Async Support
• Environment Management
• Type Safety | • Better reliability
• Improved performance
• Easy configuration
• Safer code | +| 🎯 Use Case Support | • Task-Specific Agents
• Custom Workflows
• Industry Solutions
• Extensible Framework | • Quick deployment
• Flexible solutions
• Industry readiness
• Easy customization | + ---- diff --git a/swarms/tools/e2b_tool.py b/swarms/tools/e2b_tool.py deleted file mode 100644 index 5f8ef4d9..00000000 --- a/swarms/tools/e2b_tool.py +++ /dev/null @@ -1,91 +0,0 @@ -import subprocess -import sys -from loguru import logger -from typing import Tuple, Union, List -from e2b_code_interpreter import CodeInterpreter - -# load_dotenv() - - -# Helper function to lazily install the package if not found -def lazy_install(package: str) -> None: - try: - __import__(package) - except ImportError: - logger.warning(f"{package} not found. Installing now...") - subprocess.check_call( - [sys.executable, "-m", "pip", "install", package] - ) - - -# Ensure e2b_code_interpreter is installed lazily -lazy_install("e2b_code_interpreter") - - -def code_interpret( - code_interpreter: CodeInterpreter, code: str -) -> Union[Tuple[List[str], List[str]], None]: - """ - Runs AI-generated code using the provided CodeInterpreter and logs the process. - - Args: - code_interpreter (CodeInterpreter): An instance of the CodeInterpreter class. - code (str): The code string to be executed. - - Returns: - Union[Tuple[List[str], List[str]], None]: A tuple of (results, logs) if successful, - or None if an error occurred. - - Raises: - ValueError: If the code or code_interpreter is invalid. - """ - if not isinstance(code_interpreter, CodeInterpreter): - logger.error("Invalid CodeInterpreter instance provided.") - raise ValueError( - "code_interpreter must be an instance of CodeInterpreter." - ) - if not isinstance(code, str) or not code.strip(): - logger.error("Invalid code provided.") - raise ValueError("code must be a non-empty string.") - - logger.info( - f"\n{'='*50}\n> Running the following AI-generated code:\n{code}\n{'='*50}" - ) - - try: - exec_result = code_interpreter.notebook.exec_cell( - code, - # on_stderr=lambda stderr: logger.error(f"[Code Interpreter stderr] {stderr}"), - # on_stdout=lambda stdout: logger.info(f"[Code Interpreter stdout] {stdout}") - ) - - if exec_result.error: - logger.error( - f"[Code Interpreter error] {exec_result.error}" - ) - return None - else: - logger.success("Code executed successfully.") - # return exec_result.results, exec_result.logs - # return exec_result.results - prompt = f"{exec_result.results}: {exec_result.logs}" - return prompt - - except Exception: - logger.exception( - "An error occurred during code interpretation." - ) - return None - - -# # from e2b_code_interpreter import CodeInterpreter - -# interpreter = CodeInterpreter() -# code = "print('Hello, World!')" - -# result = code_interpret(interpreter, code) - -# if result: -# results = result -# print("Execution Results:", results) -# # print("Execution Logs:", logs)