Skip to content

Agent Zero AI framework

searxng fix, ui animation

frdel06260ed4a6b8
diff --git a/docker/run/fs/etc/searxng/settings.yml b/docker/run/fs/etc/searxng/settings.yml
index 7b9f3b0d1..bafdc17cf 100644
--- a/docker/run/fs/etc/searxng/settings.yml
+++ b/docker/run/fs/etc/searxng/settings.yml
@@ -7,24 +7,24 @@ general:
instance_name: "SearXNG"
search:
- safe_search: 2
- autocomplete: 'duckduckgo'
+ safe_search: 0
+ # autocomplete: 'duckduckgo'
formats:
- - html
- json
+ # - html
server:
# Is overwritten by ${SEARXNG_SECRET}
- secret_key: "1e91dce279fdef87eb7b6f43029c206b"
- limiter: true
- image_proxy: true
+ secret_key: "dummy"
+ limiter: false
+ image_proxy: false
# public URL of the instance, to ensure correct inbound links. Is overwritten
# by ${SEARXNG_URL}.
# base_url: http://example.com/location
-redis:
- # URL to connect redis database. Is overwritten by ${SEARXNG_REDIS_URL}.
- url: unix:///usr/local/searxng-redis/run/redis.sock?db=0
+# redis:
+# # URL to connect redis database. Is overwritten by ${SEARXNG_REDIS_URL}.
+# url: unix:///usr/local/searxng-redis/run/redis.sock?db=0
ui:
static_use_hash: true
diff --git a/docker/run/fs/exe/run_A0.sh b/docker/run/fs/exe/run_A0.sh
index 4ec5f32b7..697272510 100644
--- a/docker/run/fs/exe/run_A0.sh
+++ b/docker/run/fs/exe/run_A0.sh
@@ -17,20 +17,24 @@ function setup_venv() {
source /opt/venv/bin/activate
}
-# preload A0
+function clone_repo() {
+ # Copy repository files if run_ui.py is missing in /a0 (if the volume is mounted)
+ if [ ! -f "$TARGET_DIR/run_ui.py" ]; then
+ echo "Copying files from $SOURCE_DIR to $TARGET_DIR..."
+ cp -rn --no-preserve=ownership,mode "$SOURCE_DIR/." "$TARGET_DIR"
+ fi
+}
+
+# setup and preload A0
setup_venv
+clone_repo
python /a0/preload.py
# Loop to restart the Python script when it finishes
while true; do
setup_venv
-
- # Copy repository files if run_ui.py is missing in /a0 (if the volume is mounted)
- if [ ! -f "$TARGET_DIR/run_ui.py" ]; then
- echo "Copying files from $SOURCE_DIR to $TARGET_DIR..."
- cp -rn --no-preserve=ownership,mode "$SOURCE_DIR/." "$TARGET_DIR"
- fi
+ clone_repo
echo "Starting A0..."
python /a0/run_ui.py \
diff --git a/webui/index.css b/webui/index.css
index 303925fc2..a3b38a11d 100644
--- a/webui/index.css
+++ b/webui/index.css
@@ -473,6 +473,27 @@ pre {
margin-right: 1.2em;
}
+.shiny-text {
+ background: linear-gradient(
+ to right,
+ var(--color-primary-dark) 20%,
+ var(--color-text) 40%,
+ var(--color-text) 60%,
+ var(--color-primary-dark) 60%
+ );
+ background-size: 200% auto;
+ color: transparent;
+ -webkit-background-clip: text;
+ background-clip: text;
+ animation: shine 1s linear infinite;
+}
+
+@keyframes shine {
+ to {
+ background-position: -200% center;
+ }
+}
+
#right-panel.expanded #logo-container {
margin-left: 4.6rem;
}
diff --git a/webui/index.js b/webui/index.js
index c52729c79..15143e252 100644
--- a/webui/index.js
+++ b/webui/index.js
@@ -372,7 +372,7 @@ async function poll() {
}
function afterMessagesUpdate(logs) {
- if(localStorage.getItem('speech') == 'true') {
+ if (localStorage.getItem('speech') == 'true') {
speakMessages(logs)
}
}
@@ -392,7 +392,14 @@ function speakMessages(logs) {
}
function updateProgress(progress) {
- if (!progress) progress = "Waiting for input"
+ const defaultText = "Waiting for input"
+ if (!progress) progress = defaultText
+
+ if (progress == defaultText) {
+ removeClassFromElement(progressBar, "shiny-text")
+ } else {
+ addClassToElement(progressBar, "shiny-text")
+ }
if (progressBar.innerHTML != progress) {
progressBar.innerHTML = progress
@@ -500,7 +507,7 @@ window.toggleDarkMode = function (isDark) {
window.toggleSpeech = function (isOn) {
console.log("Speech:", isOn);
localStorage.setItem('speech', isOn);
- if(!isOn) speech.stop()
+ if (!isOn) speech.stop()
};
// Modify this part
@@ -651,6 +658,14 @@ function readJsonFiles() {
});
}
+function addClassToElement(element, className) {
+ element.classList.add(className);
+}
+
+function removeClassFromElement(element, className) {
+ element.classList.remove(className);
+}
+
function toast(text, type = 'info') {
const toast = document.getElementById('toast');
diff --git a/webui/speech.js b/webui/speech.js
index cbf8be179..4e8e9b5c3 100644
--- a/webui/speech.js
+++ b/webui/speech.js
@@ -422,9 +422,14 @@ class Speech {
replaceNonText(text) {
const nonTextRegex = /\w[^\w\s]*\w(?=\s|$)|[^\w\s]+/g;
- return text.replace(nonTextRegex, (match) => {
+ text = text.replace(nonTextRegex, (match) => {
return ``;
});
+ const longStringRegex = /\S{25,}/g;
+ text = text.replace(longStringRegex, (match) => {
+ return ``;
+ });
+ return text
}
stop() {