diff --git a/src/llm/mod.rs b/src/llm/mod.rs index 3d6491e3..aca32f86 100644 --- a/src/llm/mod.rs +++ b/src/llm/mod.rs @@ -68,10 +68,18 @@ impl LLMProvider for OpenAIClient { .await?; let result: Value = response.json().await?; - let content = result["choices"][0]["message"]["content"] + let raw_content = result["choices"][0]["message"]["content"] .as_str() - .unwrap_or("") - .to_string(); + .unwrap_or(""); + // Define the end token we want to skip up to. Adjust the token string if needed. + let end_token = "final<|message|>"; + let content = if let Some(pos) = raw_content.find(end_token) { + // Skip everything up to and including the end token. + raw_content[(pos + end_token.len())..].to_string() + } else { + // If the token is not found, return the full content. + raw_content.to_string() + }; Ok(content) } diff --git a/templates/annoucements.gbai/annoucements.gbdialog/start.bas b/templates/annoucements.gbai/annoucements.gbdialog/start.bas index 82782c37..6e49dc23 100644 --- a/templates/annoucements.gbai/annoucements.gbdialog/start.bas +++ b/templates/annoucements.gbai/annoucements.gbdialog/start.bas @@ -3,7 +3,5 @@ TALK "Olá, pode me perguntar sobre qualquer coisa..." let text = GET "default.gbdrive/default.pdf" let resume = LLM "Say Hello and present a a resume from " + text TALK resume - SET_CONTEXT "Este é o documento que você deve usar para responder dúvidas: " + text - return true; diff --git a/web/index.html b/web/index.html index 28547054..d5ce63df 100644 --- a/web/index.html +++ b/web/index.html @@ -436,34 +436,57 @@ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); } + /* Updated Connection Status - Small Flashing Circle */ .connection-status { position: fixed; - top: 10px; - right: 10px; - padding: 8px 12px; - border-radius: 20px; - font-size: 12px; - font-weight: 600; + top: 15px; + right: 15px; + width: 16px; + height: 16px; + border-radius: 50%; z-index: 1000; transition: all 0.3s ease; - } - - .connection-status.connected { - background: rgba(100, 255, 100, 0.2); - border: 1px solid rgba(100, 255, 100, 0.4); - color: #90ff90; - } - - .connection-status.disconnected { - background: rgba(255, 100, 100, 0.2); - border: 1px solid rgba(255, 100, 100, 0.4); - color: #ff9090; + box-shadow: 0 0 10px currentColor; } .connection-status.connecting { - background: rgba(255, 215, 0, 0.2); - border: 1px solid rgba(255, 215, 0, 0.4); - color: #ffd700; + background-color: #ffd700; + animation: connectingPulse 1.5s infinite; + } + + .connection-status.connected { + background-color: #90ee90; + animation: connectedPulse 2s infinite; + } + + .connection-status.disconnected { + background-color: #ff6b6b; + animation: none; + } + + @keyframes connectingPulse { + 0%, + 100% { + opacity: 0.6; + transform: scale(0.8); + } + 50% { + opacity: 1; + transform: scale(1); + } + } + + @keyframes connectedPulse { + 0%, + 100% { + opacity: 0.8; + transform: scale(1); + } + 50% { + opacity: 1; + transform: scale(1.1); + box-shadow: 0 0 15px #90ee90; + } } /* Markdown Styles */ @@ -648,10 +671,10 @@ } .connection-status { - top: 5px; - right: 5px; - font-size: 10px; - padding: 6px 10px; + top: 10px; + right: 10px; + width: 14px; + height: 14px; } } @@ -688,9 +711,7 @@
-