Spaces:
Sleeping
Sleeping
File size: 1,138 Bytes
89784d2 cb3bc65 89784d2 c70570c c363697 c70570c 89784d2 c363697 c70570c 5e2c798 89784d2 c363697 c70570c c363697 c70570c 5e2c798 |
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 38 |
# app.py
import gradio as gr
from multi_inference import multi_query as deepseek_query
from agents.philosopher import PhilosopherAgent
from agents.historian import HistorianAgent
from agents.hacker import HackerAgent
from agents.comedian import ComedianAgent
# Initialize agent classes
philosopher = PhilosopherAgent()
historian = HistorianAgent()
hacker = HackerAgent()
comedian = ComedianAgent()
# Chat function
def chat(prompt):
responses = {}
responses["π§ββοΈ Philosopher"] = philosopher.run(prompt, deepseek_query)
responses["π¨βπ« Historian"] = historian.run(prompt, deepseek_query)
responses["π» Hacker"] = hacker.run(prompt, deepseek_query)
responses["π Comedian"] = comedian.run(prompt, deepseek_query)
return responses
# Gradio UI setup
demo = gr.Interface(
fn=chat,
inputs=gr.Textbox(label="Ask a Question"),
outputs=gr.JSON(label="Agent Responses"),
title="π§ Multi-Agent AI Chatroom",
description="Ask anything. Each AI agent gives a unique answer!"
)
# Only launch if run directly (used by Hugging Face too)
if __name__ == "__main__":
demo.launch()
|