melhorias interface

This commit is contained in:
João Pedro Toledo Goncalves 2026-01-08 20:48:35 -03:00
parent b75f73f46a
commit ea51a6e68f
3 changed files with 56 additions and 19 deletions

View File

@ -1,14 +1,34 @@
# Welcome to Chainlit! 🚀🤖
# Antigravity Brain - Minions da ITGuys
Hi there, Developer! 👋 We're excited to have you on board. Chainlit is a powerful tool designed to help you prototype, debug and share applications built on top of LLMs.
Bem-vindo ao centro de comando da **Inteligência Artificial Corporativa da ITGuys**.
## Useful Links 🔗
Aqui você tem acesso a **26 Agentes Especializados** prontos para colaborar, resolver problemas complexos e executar tarefas em nossa infraestrutura e negócios.
- **Documentation:** Get started with our comprehensive [Chainlit Documentation](https://docs.chainlit.io) 📚
- **Discord Community:** Join our friendly [Chainlit Discord](https://discord.gg/k73SQ3FyUh) to ask questions, share your projects, and connect with other developers! 💬
---
We can't wait to see what you create with Chainlit! Happy coding! 💻😊
## O que podemos fazer por você hoje?
## Welcome screen
### Engenharia & Infraestrutura
* **Arthur M. & Gus Fring:** Automação Zabbix, validação de templates e estabilidade de sistemas.
* **Tony Stark:** DevOps e automação de código.
To modify the welcome screen, edit the `chainlit.md` file at the root of your project. If you do not want a welcome screen, just leave this file empty.
### Segurança Ofensiva & Defensiva
* **Elliot & Devil:** Testes de intrusão, segurança e auditoria de vulnerabilidades.
### Negócios & Estratégia
* **Harvey & Kevin:** Compliance jurídico, análise de ROI e estratégia corporativa.
### Vendas & Crescimento
* **Ari Gold & Don Draper:** Fechamento de negócios, pitches e prospecção agressiva.
---
## Como usar?
Basta digitar sua solicitação naturalmente. O sistema de **Roteamento Inteligente** irá invocar a Crew ou Agente ideal para o seu problema.
> **Exemplo:** "Preciso validar um template do Zabbix" ou "Crie uma estratégia de vendas para o novo produto".
---
*Sistema Privado ITGuys - Acesso Restrito*

View File

@ -0,0 +1,15 @@
---
description: Persona - React Expert (Frontend Engineer)
llm_config:
provider: default
---
# 👤 Persona: React Expert
**Role:** Frontend Engineer
**Goal:** Provide expert guidance on React component creation and best practices.
## 🧠 Backstory
A seasoned frontend engineer with extensive experience in React development, specializing in component architecture and performance optimization.

View File

@ -8,8 +8,8 @@ from src.router import SmartRouter
@cl.on_chat_start
async def on_chat_start():
# No more menus! Just a welcome.
await cl.Message(content="🧠 **Antigravity Brain Online.**\n\nI am ready. Just tell me what you need (e.g., *'Check the server health'* or *'Create a new agent named Bob'*).").send()
# Welcome message without emojis, more natural
await cl.Message(content="**Antigravity Brain Online**\n\nEstou pronto para ajudar. Pode me dizer o que precisa? Por exemplo: *'Verificar a saúde do servidor'* ou *'Criar um novo agente'*.").send()
cl.user_session.set("selected_crew", None)
@cl.on_message
@ -19,7 +19,7 @@ async def on_message(message: cl.Message):
# 1. Check for commands
if user_input.strip() == "/reset":
cl.user_session.set("selected_crew", None)
await cl.Message(content="🔄 Session reset. I will re-evaluate the best crew for your next request.").send()
await cl.Message(content="Sessão reiniciada. Vou reavaliar a melhor equipe para sua próxima solicitação.").send()
return
# 2. Determine Crew
@ -33,17 +33,19 @@ async def on_message(message: cl.Message):
# No, that's risky. Let's stick to: Route First -> Sticky -> User can /reset.
if not current_crew:
msg_routing = cl.Message(content="🤔 Analyzing request...")
# Show loading indicator while routing
msg_routing = cl.Message(content="Analisando sua solicitação...")
await msg_routing.send()
current_crew = SmartRouter.route(user_input)
cl.user_session.set("selected_crew", current_crew)
await msg_routing.update()
await cl.Message(content=f"👉 **Routing to:** {current_crew}").send()
await cl.Message(content=f"**Direcionando para:** {current_crew}").send()
# 3. Execution
msg = cl.Message(content=f"🚀 **{current_crew}** is working on it...")
# 3. Execution with proper loading indicator
# Create a message that will show loading state and be updated with the result
msg = cl.Message(content=f"**{current_crew}** está processando sua solicitação...")
await msg.send()
try:
@ -55,12 +57,12 @@ async def on_message(message: cl.Message):
result = crew.kickoff(inputs={"topic": user_input})
final_answer = str(result)
# Update message
msg.content = f"### ✅ Report from {current_crew}\n\n{final_answer}"
# Update message with final result
msg.content = f"### Relatório de {current_crew}\n\n{final_answer}"
await msg.update()
except Exception as e:
msg.content = f"❌ **Mission Failed:** {str(e)}"
msg.content = f"**Erro ao processar solicitação:** {str(e)}"
await msg.update()
# Reset crew on failure so user can try again or get re-routed
cl.user_session.set("selected_crew", None)
cl.user_session.set("selected_crew", None)