From 7722c66d4c0a84541f2c115c37e8bb7d6ecb0cd1 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Sun, 12 Oct 2025 17:41:41 -0300 Subject: [PATCH] Migrate to web/index.html and OpenAI client - Load index.html from web/index.html instead of templates/static - Initialize OpenAIClient with an empty key and local endpoint - Remove the old static/index.html file --- src/bot/mod.rs | 3 +- src/main.rs | 5 +- {static => web}/index.html | 582 +++++++++++++++++++++++++++---------- 3 files changed, 426 insertions(+), 164 deletions(-) rename {static => web}/index.html (50%) diff --git a/src/bot/mod.rs b/src/bot/mod.rs index 6f4c4ec11..4b43dbd67 100644 --- a/src/bot/mod.rs +++ b/src/bot/mod.rs @@ -686,8 +686,7 @@ async fn set_mode_handler( #[actix_web::get("/")] async fn index() -> Result { - let html = fs::read_to_string("templates/index.html") - .unwrap_or_else(|_| include_str!("../../static/index.html").to_string()); + let html = fs::read_to_string("web/index.html").unwrap(); Ok(HttpResponse::Ok().content_type("text/html").body(html)) } diff --git a/src/main.rs b/src/main.rs index f1521517c..f88dae4a1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,7 +105,10 @@ async fn main() -> std::io::Result<()> { }; let tool_manager = Arc::new(tools::ToolManager::new()); - let llm_provider = Arc::new(llm::MockLLMProvider::new()); + let llm_provider = Arc::new(llm::OpenAIClient::new( + "empty".to_string(), + Some("http://localhost:8081".to_string()), + )); let web_adapter = Arc::new(WebChannelAdapter::new()); let voice_adapter = Arc::new(VoiceAdapter::new( diff --git a/static/index.html b/web/index.html similarity index 50% rename from static/index.html rename to web/index.html index 242a09d60..af6bbc436 100644 --- a/static/index.html +++ b/web/index.html @@ -1,122 +1,162 @@ - + - General Bots + + General Bots 2400 + + + + + - + +
+ + +
+
+
+
+ D +
+

+ General Bots +

+
+ + +
+ -
-
- - +
🎤 Ouvindo... Fale agora
+ +
+
+
+ D +
+

+ Bem-vindo ao General Bots +

+

+ Seu assistente de IA avançado +

+
+
+ +
+
+ + +
+
-