From 0fca13a505139789087d2521136f05ddf9b91f47 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 2 Jun 2025 10:48:20 +0200 Subject: [PATCH] voice fixes, custom voice for page, upload fixes, layoutbuilder, database extensions --- Components/Layout/NavMenu.razor | 1 + Components/Pages/AgentTestKids.razor | 33 +- Components/Pages/Index.razor | 35 +- Components/Pages/ManageSiteInfo.razor | 6 +- Components/Pages/Preview.razor | 42 +- Components/Pages/Sites.razor | 12 +- Components/Partials/NavMenu.razor | 23 +- ...0602055410_addVoiceInformation.Designer.cs | 637 ++ .../20250602055410_addVoiceInformation.cs | 55 + .../ApplicationDbContextModelSnapshot.cs | 9 + Models/HtmlSnippet.cs | 4 +- Models/LayoutBlock.cs | 28 + Models/LayoutPlan.cs | 8 + Models/SiteInfo.cs | 4 + Services/AIService.cs | 742 +- wwwroot/main.css | 88 + wwwroot/temp/style_2fd95e71.css | 168 + wwwroot/temp/style_3845bc26.css | 168 + wwwroot/temp/style_4ee82aa9.css | 168 + wwwroot/temp/style_54967dd0.css | 168 + ...{style_48e0cb84.css => style_7ac1c30c.css} | 48 +- wwwroot/temp/style_7fd361e7.css | 536 + wwwroot/temp/style_8bb509ba.css | 536 + wwwroot/temp/style_921c5e4e.css | 9073 +++++++++++++++++ wwwroot/temp/style_9ea4bd8c.css | 536 + wwwroot/temp/style_a5faf300.css | 168 + wwwroot/temp/style_e0642a6c.css | 168 + ..._8553833781365611_797678058825756959_n.jpg | Bin 263774 -> 331478 bytes ...8580788705336785_8040240833958164225_n.jpg | Bin 0 -> 72844 bytes .../images/Hero.png | Bin 0 -> 1604130 bytes .../images/Robotics.png | Bin 0 -> 2623959 bytes .../images/Seemgen_logo_1000.png | Bin 0 -> 191251 bytes .../images/ai_voice_agent.jpg | Bin 0 -> 423072 bytes .../images/beleptetorendszerek.jpg | Bin 0 -> 613015 bytes .../images/csomagok.png | Bin 0 -> 1208108 bytes .../images/gepilatas.jpg | Bin 0 -> 606353 bytes .../images/ipar40.jpg | Bin 0 -> 859850 bytes .../images/seemgen.png | Bin 0 -> 1791132 bytes .../images/szoftverrobotok.jpg | Bin 0 -> 890252 bytes .../images/voicechat.png | Bin 0 -> 1848979 bytes wwwroot/video/salespower.mp4 | Bin 20222530 -> 836992 bytes 41 files changed, 13214 insertions(+), 250 deletions(-) create mode 100644 Migrations/20250602055410_addVoiceInformation.Designer.cs create mode 100644 Migrations/20250602055410_addVoiceInformation.cs create mode 100644 Models/LayoutBlock.cs create mode 100644 Models/LayoutPlan.cs create mode 100644 wwwroot/temp/style_2fd95e71.css create mode 100644 wwwroot/temp/style_3845bc26.css create mode 100644 wwwroot/temp/style_4ee82aa9.css create mode 100644 wwwroot/temp/style_54967dd0.css rename wwwroot/temp/{style_48e0cb84.css => style_7ac1c30c.css} (93%) create mode 100644 wwwroot/temp/style_7fd361e7.css create mode 100644 wwwroot/temp/style_8bb509ba.css create mode 100644 wwwroot/temp/style_921c5e4e.css create mode 100644 wwwroot/temp/style_9ea4bd8c.css create mode 100644 wwwroot/temp/style_a5faf300.css create mode 100644 wwwroot/temp/style_e0642a6c.css create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/465164116_8580788705336785_8040240833958164225_n.jpg create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/Hero.png create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/Robotics.png create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/Seemgen_logo_1000.png create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/ai_voice_agent.jpg create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/beleptetorendszerek.jpg create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/csomagok.png create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/gepilatas.jpg create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/ipar40.jpg create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/seemgen.png create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/szoftverrobotok.jpg create mode 100644 wwwroot/uploads/0988758e-e16c-4c2c-8c1e-efa3ac5f0274/images/voicechat.png diff --git a/Components/Layout/NavMenu.razor b/Components/Layout/NavMenu.razor index 5e02743..fa232e4 100644 --- a/Components/Layout/NavMenu.razor +++ b/Components/Layout/NavMenu.razor @@ -1,5 +1,6 @@  + + @code { private string Menu = "Tanulás, Gyakorlás, Tesztelés, Vizsgázás"; diff --git a/Components/Pages/Index.razor b/Components/Pages/Index.razor index 160239e..dd31367 100644 --- a/Components/Pages/Index.razor +++ b/Components/Pages/Index.razor @@ -28,7 +28,7 @@
-
+
Home @* @@ -63,7 +63,17 @@ if(TTSEnabled) { - + if (!AiVoicePermitted) + { + + } + else + { + + } } } @@ -78,7 +88,7 @@

-
+
@{ if (!string.IsNullOrEmpty(HtmlContent.ToString())) { @@ -184,22 +194,27 @@ private bool STTEnabled; private bool _initVoicePending = false; private bool welcomeStage = true; + private bool AiVoicePermitted = false; private string GetApiKey() => configuration?.GetSection("ElevenLabsAPI")?.GetValue("ApiKey") ?? string.Empty; + private void AllowAIVoice() + { + AiVoicePermitted = true; + } private void MuteAI() { - TTSEnabled = false; + AiVoicePermitted = false; } private async Task ConvertTextToSpeech() { // string plainText = WebUtility.HtmlDecode(HtmlContent.ToString()); - if (string.IsNullOrWhiteSpace(TextContent) || VoiceEnabled == false || TTSEnabled == false || welcomeStage) + if (string.IsNullOrWhiteSpace(TextContent) || VoiceEnabled == false || TTSEnabled == false || welcomeStage || !AiVoicePermitted) return; Console.WriteLine("------------------------------OMGOMGOMG TTS call!!!!-------------"); @@ -218,7 +233,15 @@ }; var requestJson = JsonSerializer.Serialize(requestContent); - string voiceId = "rE22Kc7UGoQj4zdHNYvd"; + string voiceId; + if(SiteInfo.voiceId != null) + { + voiceId = SiteInfo.voiceId; + } + else + { + voiceId = "rE22Kc7UGoQj4zdHNYvd"; + } // string voiceId = "yyPLNYHg3CvjlSdSOdLh"; var httpRequest = new HttpRequestMessage(HttpMethod.Post, $"https://api.elevenlabs.io/v1/text-to-speech/{voiceId}/stream") diff --git a/Components/Pages/ManageSiteInfo.razor b/Components/Pages/ManageSiteInfo.razor index 8973ce5..dc13f66 100644 --- a/Components/Pages/ManageSiteInfo.razor +++ b/Components/Pages/ManageSiteInfo.razor @@ -17,7 +17,7 @@ +