pull/633/merge
Your Name 2 months ago
parent f4cf551c23
commit f132ea932a

@ -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. 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<br>• High Reliability Systems<br>• Modular Design<br>• Comprehensive Logging | • Reduced downtime<br>• Easier maintenance<br>• Better debugging<br>• Enhanced monitoring |
| 🤖 Agent Orchestration | • Hierarchical Swarms<br>• Parallel Processing<br>• Sequential Workflows<br>• Graph-based Workflows<br>• Dynamic Agent Rearrangement | • Complex task handling<br>• Improved performance<br>• Flexible workflows<br>• Optimized execution |
| 🔄 Integration Capabilities | • Multi-Model Support<br>• Custom Agent Creation<br>• Extensive Tool Library<br>• Multiple Memory Systems | • Provider flexibility<br>• Custom solutions<br>• Extended functionality<br>• Enhanced memory management |
| 📈 Scalability | • Concurrent Processing<br>• Resource Management<br>• Load Balancing<br>• Horizontal Scaling | • Higher throughput<br>• Efficient resource use<br>• Better performance<br>• Easy scaling |
| 🛠️ Developer Tools | • Simple API<br>• Extensive Documentation<br>• Active Community<br>• CLI Tools | • Faster development<br>• Easy learning curve<br>• Community support<br>• Quick deployment |
| 🔐 Security Features | • Error Handling<br>• Rate Limiting<br>• Monitoring Integration<br>• Audit Logging | • Improved reliability<br>• API protection<br>• Better monitoring<br>• Enhanced tracking |
| 📊 Advanced Features | • SpreadsheetSwarm<br>• Group Chat<br>• Agent Registry<br>• Mixture of Agents | • Mass agent management<br>• Collaborative AI<br>• Centralized control<br>• Complex solutions |
| 🔌 Provider Support | • OpenAI<br>• Anthropic<br>• ChromaDB<br>• Custom Providers | • Provider flexibility<br>• Storage options<br>• Custom integration<br>• Vendor independence |
| 💪 Production Features | • Automatic Retries<br>• Async Support<br>• Environment Management<br>• Type Safety | • Better reliability<br>• Improved performance<br>• Easy configuration<br>• Safer code |
| 🎯 Use Case Support | • Task-Specific Agents<br>• Custom Workflows<br>• Industry Solutions<br>• Extensible Framework | • Quick deployment<br>• Flexible solutions<br>• Industry readiness<br>• Easy customization |
---- ----

@ -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)
Loading…
Cancel
Save