Spaces:
Sleeping
Sleeping
File size: 1,095 Bytes
583f1ca | 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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | """
Interface gráfica da Socrática-IA usando Gradio.
Este módulo é responsável apenas pela interface.
A lógica do tutor permanece no core.
"""
import gradio as gr
from config import Config
from core.tutor import SocraticTutor
class VoiceAIInterface:
"""
Interface principal da VoiceAI.
"""
def __init__(self):
self.tutor = SocraticTutor()
def respond(self, message, history):
"""
Encaminha a mensagem do usuário para o Tutor Socrático.
"""
yield from self.tutor.respond(
message=message,
history=history
)
def launch(self):
"""
Cria e inicia a interface Gradio.
"""
chatbot = gr.ChatInterface(
fn=self.respond,
title=f"🧠 {Config.APP_NAME}",
description=Config.APP_DESCRIPTION,
)
chatbot.launch()
def create_interface():
"""
Cria uma instância da interface.
"""
return VoiceAIInterface()
if __name__ == "__main__":
interface = create_interface()
interface.launch() |