Spaces:
Sleeping
Sleeping
File size: 951 Bytes
89784d2 7337f9c 89784d2 7337f9c c363697 89784d2 c363697 7337f9c c363697 7337f9c 89784d2 7337f9c c363697 7337f9c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# app.py
import gradio as gr
from agents.philosopher import PhilosopherAgent
from agents.historian import HistorianAgent
from agents.hacker import HackerAgent
from agents.comedian import ComedianAgent
from agents.base_agent import ACPMessage
# Instantiate agents
agents = [
PhilosopherAgent(),
HistorianAgent(),
HackerAgent(),
ComedianAgent()
]
def chat(prompt):
responses = {}
for agent in agents:
try:
output = agent.generate([ACPMessage(role="user", content=prompt)])
except Exception as e:
output = f"[ERROR] {e}"
responses[agent.name] = output
return responses
iface = gr.Interface(
fn=chat,
inputs=gr.Textbox(label="Ask Something", lines=3, placeholder="Type your message here..."),
outputs="json",
title="🤖 Multi-Agent Chatroom (Groq Edition)",
description="Talk to 4 AI agents at once using free Groq-powered LLaMA3 API."
)
iface.launch()
|