""" 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()