summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-09-26 08:01:16 +0200
committerDanilo M. <danix@danix.xyz>2026-09-26 08:01:16 +0200
commit8685afde21bf8e94071dbf0b0171b4a2e91492cf (patch)
tree1c01c0ab871f8cb1cc126039e8e43f86fca69625
parentde179d288a1c67bc77756141b16e95c364e941a1 (diff)
downloaddesktop-assistant-8685afde21bf8e94071dbf0b0171b4a2e91492cf.tar.gz
desktop-assistant-8685afde21bf8e94071dbf0b0171b4a2e91492cf.zip
Add example config and the now and search tools
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-rw-r--r--examples/config.toml33
-rw-r--r--examples/tools/now.toml2
-rwxr-xr-xexamples/tools/search.sh29
-rw-r--r--examples/tools/search.toml9
4 files changed, 73 insertions, 0 deletions
diff --git a/examples/config.toml b/examples/config.toml
new file mode 100644
index 0000000..5e148b8
--- /dev/null
+++ b/examples/config.toml
@@ -0,0 +1,33 @@
+# desktop-assistant configuration. Copy to ~/.config/desktop-assistant/
+# and uncomment what you change; every key is optional and the values
+# shown are the built-in defaults. An unknown key stops the assistant
+# with its name, so a typo cannot fall back to a default in silence.
+
+# card = "Microphone" # ALSA card id of the mic
+# llm = "http://localhost:8181/v1" # llama-server, OpenAI API
+# system = "You are a voice assistant. ..."
+# tool_rounds = 3 # tool round trips per question
+
+# [whisper]
+# model = "/data/voice-models/whisper/ggml-large-v3-turbo-q5_0.bin"
+# device = 0 # -dev index, GPU devices only
+# port = 8182
+
+# [kokoro]
+# model = "/data/voice-models/kokoro/kokoro-v1.0.onnx"
+# voices = "/data/voice-models/kokoro/voices-v1.0.bin"
+
+# Style name = weight; a blend replaces the default blend whole.
+# [voice.it]
+# lang = "it"
+# blend = { if_sara = 0.8, af_bella = 0.2 }
+# [voice.en]
+# lang = "en-us"
+# blend = { af_heart = 1.0 }
+
+# Added to every tool's environment. Personal values live here, not in
+# the tool files.
+[env]
+# SEARXNG_URL = "http://searxng.example.org"
+# WEATHER_ENV = "/home/you/.config/udt/weather.env"
+# CALENDAR_DIR = "/home/you/.local/share/calendars"
diff --git a/examples/tools/now.toml b/examples/tools/now.toml
new file mode 100644
index 0000000..c52a4fe
--- /dev/null
+++ b/examples/tools/now.toml
@@ -0,0 +1,2 @@
+description = "Current local date and time."
+command = ["date", "+%A %d %B %Y, %H:%M"]
diff --git a/examples/tools/search.sh b/examples/tools/search.sh
new file mode 100755
index 0000000..a7d05dc
--- /dev/null
+++ b/examples/tools/search.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+# desktop-assistant tool: web search through a SearXNG instance.
+# Copyright (C) 2026 Danilo M. <danix@danix.xyz>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# search.sh QUERY: prints the top 5 results as "title: snippet".
+# Needs SEARXNG_URL (config.toml [env]) with the JSON format enabled.
+
+set -uo pipefail
+
+[ -n "${SEARXNG_URL:-}" ] || { echo "SEARXNG_URL is not set" >&2; exit 1; }
+[ -n "${1:-}" ] || { echo "empty query" >&2; exit 1; }
+
+curl -fsS --max-time 8 --get "$SEARXNG_URL/search" \
+ --data-urlencode "q=$1" --data-urlencode "format=json" \
+ | jq -r '.results[:5][] | "\(.title): \(.content // "")"' \
+ || { echo "search failed" >&2; exit 1; }
diff --git a/examples/tools/search.toml b/examples/tools/search.toml
new file mode 100644
index 0000000..2c6919e
--- /dev/null
+++ b/examples/tools/search.toml
@@ -0,0 +1,9 @@
+description = "Search the web. Use it for facts, news, distances, prices, anything you are not sure about, instead of guessing."
+command = ["search.sh", "{query}"]
+timeout = 10
+announce.it = ["Cerco un attimo.", "Vediamo cosa trovo.", "Controllo."]
+announce.en = ["Let me look that up.", "Let me see what I can find.", "Checking."]
+
+[params.query]
+type = "string"
+description = "Search terms"