from bindu.penguin.bindufy import bindufy
from orchestrator import Orchestrator
from dotenv import load_dotenv
load_dotenv()
orchestrator = Orchestrator()
def handler(messages: list[dict[str, str]]) -> str:
if not isinstance(messages, list):
return "Invalid input format: messages must be a list."
if not messages:
return "No input message received."
last_msg = messages[-1]
if not isinstance(last_msg, dict):
return "Invalid message structure."
user_input = last_msg.get("content")
if not user_input or not isinstance(user_input, str):
return "Empty or invalid message content."
try:
result = orchestrator.run(user_input)
return result
except Exception as e:
return f"Internal agent error: {str(e)}"
config = {
"author": "[email protected]",
"name": "killer-agent-swarm",
"description": "Multi-agent AI system for deep research, summarization, critique and reflection.",
"capabilities": {"streaming": True},
"deployment": {
"url": "http://localhost:3773",
"expose": True,
"cors_origins": ["http://localhost:5173"]
},
"skills": ["skills/agent-swarm-intelligence"],
"storage": {"type": "memory"},
"scheduler": {"type": "memory"}
}
bindufy(config=config, handler=handler)
#bindufy(config, handler, launch=True)
# This will create a tunnel to your agent and expose it on port 3773