pull/160/head
Kye 2 years ago
parent 30c1f7d25d
commit e9ea31c615

1
.gitignore vendored

@ -10,3 +10,4 @@ dataframe/
static/generated
swarms/__pycache__
venv

@ -10,4 +10,29 @@ The secret to achieving this lies in our open-source approach and the power of t
At Agora, we believe in the transformative potential of this technology, and we are committed to making it a reality. Our world-class team of researchers, engineers, and AI enthusiasts are singularly focused on this mission. With a proven track record of success, and the tenacity to tackle the most complex problems, we are best positioned to lead this charge.
We invite you to join us on this exciting journey. Let's come together to create swarms, advance humanity, and redefine what is possible with artificial intelligence. Our future is in our hands. Let's shape it together.
We invite you to join us on this exciting journey. Let's come together to create swarms, advance humanity, and redefine what is possible with artificial intelligence. Our future is in our hands. Let's shape it together.
#2
Swarms is a fluid, seamless, and reliable framework for scaling up LLM autonomous agent interactions to automate digital tasks.
Like a chorus harmonizing to create a more beautiful melody, Swarms transforms isolated AI models into a cooperative network that can achieve feats beyond the capacity of any single model.
Our product is not merely an abstract idea or a dream for the future - it's a reality, right here, right now. Swarms is an accessible, easy-to-use platform. All it takes is a simple 'pip install swarms' command, or a 'git clone' from our GitHub repository, and the swarming power of AI is at your fingertips.
The fundamental functionality of Swarms is simple: it facilitates dynamic interaction and cooperation among AI models. Users set an objective, and the swarm of AI agents collectively process the task, pooling their strengths to provide a more refined, intelligent output.
With Swarms, you're not just using a tool, you're unlocking the next level of AI. You're interacting with a cooperative entity that can tackle complex problems, refine outputs, and ultimately, revolutionize the way we utilize AI.
Our vision is to see Swarms employed across various domains, from customer support to content creation, and research to robotics, expanding the possibilities of what AI can achieve. This isn't just an improvement of existing systems, but a groundbreaking leap forward in AI capability. It's about breaking down the silos, fostering collaboration, and elevating collective intelligence.
At the heart of our product, Swarms, is the principle of cooperative intelligence. Swarms is an AI-based technology that enables multiple autonomous agents, or "worker bees," to coordinate, collaborate, and generate solutions that no single agent could achieve on its own. Think of it as a digital hive mind that decomposes a large objective into manageable subtasks, distributes these tasks amongst the autonomous agents, and then assembles the results into a coherent whole.
In action, the process is fluid, elegant, and surprisingly human-like. An objective is presented to the Swarm - this could be anything from conducting web-based research to producing a report or analyzing a complex dataset. The Swarm, with its innate ability to decompose tasks, breaks the objective down into bite-sized components. Each of these components is then dispatched to a worker agent, equipped with the tools and capabilities to tackle it.
These agents are not mere receivers of instructions. They are sophisticated, multimodal, AI entities capable of browsing the web, ingesting and understanding data, interacting with digital interfaces, and even spawning additional worker agents when necessary. These agents carry out their assigned tasks autonomously, converging their efforts towards the overall objective.
In practical terms, Swarms is as versatile as it is powerful. For a business seeking to automate its customer support system, Swarms could manage incoming queries, distribute them amongst the worker agents, and generate appropriate responses based on the customer's needs. In a research context, Swarms could ingest large volumes of data, identify key areas of interest, and provide comprehensive analyses, all without human intervention.
What sets Swarms apart is its ability to harness the power of collective intelligence, the same principle that allows a flock of birds to move in unison or a colony of ants to construct complex structures. By enabling AI agents to cooperate in this way, Swarms isn't just pushing the boundaries of what AI can do it's redefining them. And it all starts with a simple 'pip install swarms' or 'git clone' from our GitHub repository. Welcome to the age of cooperative AI.

@ -1,5 +1,5 @@
import os
from swarms import Swarms
from swarms.swarms import Swarms
# Retrieve your API key from the environment or replace with your actual key

@ -241,110 +241,110 @@ class ToolsFactory:
##########################################+> SYS
import signal
from typing import Optional, Tuple
from ptrace.debugger import (
NewProcessEvent,
ProcessExecution,
ProcessExit,
ProcessSignal,
PtraceDebugger,
PtraceProcess,
)
from ptrace.func_call import FunctionCallOptions
from ptrace.syscall import PtraceSyscall
from ptrace.tools import signal_to_exitcode
class SyscallTimeoutException(Exception):
def __init__(self, pid: int, *args) -> None:
super().__init__(f"deadline exceeded while waiting syscall for {pid}", *args)
class SyscallTracer:
def __init__(self, pid: int):
self.debugger: PtraceDebugger = PtraceDebugger()
self.pid: int = pid
self.process: PtraceProcess = None
def is_waiting(self, syscall: PtraceSyscall) -> bool:
if syscall.name.startswith("wait"):
return True
return False
def attach(self):
self.process = self.debugger.addProcess(self.pid, False)
def detach(self):
self.process.detach()
self.debugger.quit()
def set_timer(self, timeout: int):
def handler(signum, frame):
raise SyscallTimeoutException(self.process.pid)
signal.signal(signal.SIGALRM, handler)
signal.alarm(timeout)
def reset_timer(self):
signal.alarm(0)
def wait_syscall_with_timeout(self, timeout: int):
self.set_timer(timeout)
self.process.waitSyscall()
self.reset_timer()
def wait_until_stop_or_exit(self) -> Tuple[Optional[int], str]:
self.process.syscall()
exitcode = None
reason = ""
while True:
if not self.debugger:
break
try:
self.wait_syscall_with_timeout(30)
except ProcessExit as event:
if event.exitcode is not None:
exitcode = event.exitcode
continue
except ProcessSignal as event:
event.process.syscall(event.signum)
exitcode = signal_to_exitcode(event.signum)
reason = event.reason
continue
except NewProcessEvent as event:
continue
except ProcessExecution as event:
continue
except Exception as e:
reason = str(e)
break
syscall = self.process.syscall_state.event(
FunctionCallOptions(
write_types=False,
write_argname=False,
string_max_length=300,
replace_socketcall=True,
write_address=False,
max_array_count=20,
)
)
# import signal
# from typing import Optional, Tuple
# from ptrace.debugger import (
# NewProcessEvent,
# ProcessExecution,
# ProcessExit,
# ProcessSignal,
# PtraceDebugger,
# PtraceProcess,
# )
# from ptrace.func_call import FunctionCallOptions
# from ptrace.syscall import PtraceSyscall
# from ptrace.tools import signal_to_exitcode
# class SyscallTimeoutException(Exception):
# def __init__(self, pid: int, *args) -> None:
# super().__init__(f"deadline exceeded while waiting syscall for {pid}", *args)
# class SyscallTracer:
# def __init__(self, pid: int):
# self.debugger: PtraceDebugger = PtraceDebugger()
# self.pid: int = pid
# self.process: PtraceProcess = None
# def is_waiting(self, syscall: PtraceSyscall) -> bool:
# if syscall.name.startswith("wait"):
# return True
# return False
# def attach(self):
# self.process = self.debugger.addProcess(self.pid, False)
# def detach(self):
# self.process.detach()
# self.debugger.quit()
# def set_timer(self, timeout: int):
# def handler(signum, frame):
# raise SyscallTimeoutException(self.process.pid)
# signal.signal(signal.SIGALRM, handler)
# signal.alarm(timeout)
# def reset_timer(self):
# signal.alarm(0)
# def wait_syscall_with_timeout(self, timeout: int):
# self.set_timer(timeout)
# self.process.waitSyscall()
# self.reset_timer()
# def wait_until_stop_or_exit(self) -> Tuple[Optional[int], str]:
# self.process.syscall()
# exitcode = None
# reason = ""
# while True:
# if not self.debugger:
# break
# try:
# self.wait_syscall_with_timeout(30)
# except ProcessExit as event:
# if event.exitcode is not None:
# exitcode = event.exitcode
# continue
# except ProcessSignal as event:
# event.process.syscall(event.signum)
# exitcode = signal_to_exitcode(event.signum)
# reason = event.reason
# continue
# except NewProcessEvent as event:
# continue
# except ProcessExecution as event:
# continue
# except Exception as e:
# reason = str(e)
# break
# syscall = self.process.syscall_state.event(
# FunctionCallOptions(
# write_types=False,
# write_argname=False,
# string_max_length=300,
# replace_socketcall=True,
# write_address=False,
# max_array_count=20,
# )
# )
self.process.syscall()
# self.process.syscall()
if syscall is None:
continue
# if syscall is None:
# continue
if syscall.result:
continue
# if syscall.result:
# continue
self.reset_timer()
# self.reset_timer()
return exitcode, reason
##########################################+> SYS CALL END
# return exitcode, reason
# ##########################################+> SYS CALL END

Loading…
Cancel
Save