Handle speech transcription variants in tool routing

This commit is contained in:
Mikei386 committed 2026-08-23 19:06:48 +02:00
1 parent e9b647e579
commit c3e44b18f8
2 files changed
+28 -6

No files matched your search

+20
View File
@@ -150,6 +150,26 @@ class AutoToolSelectorTests(unittest.IsolatedAsyncioTestCase):
) )
self.assertNotIn("server:mcp:mua", result["tool_ids"]) self.assertNotIn("server:mcp:mua", result["tool_ids"])
async def test_voice_transcription_variants_select_unraid(self):
result = await self._select(
"Welche Dacher Contäner laufen aktuell auf dem Anrate Server?"
)
self.assertEqual(
result["tool_ids"], ["server:mcp:unraid-readonly-local"]
)
async def test_navidrome_is_selected(self):
result = await self._select(
"Schau in Navidrome nach ähnlichen Titeln und meiner Playlist."
)
self.assertEqual(result["tool_ids"], ["server:mcp:navidrome-local"])
async def test_platform_context_is_selected(self):
result = await self._select(
"Wie ist der KI-Host Athena aufgebaut und wo liegt der Recovery-Koffer?"
)
self.assertEqual(result["tool_ids"], ["server:mcp:athena-platform"])
async def test_github_and_explicit_web_are_bounded_to_two(self): async def test_github_and_explicit_web_are_bounded_to_two(self):
result = await self._select( result = await self._select(
"Prüfe dieses GitHub Repository und suche zusätzlich im Netz nach Nutzerstimmen." "Prüfe dieses GitHub Repository und suche zusätzlich im Netz nach Nutzerstimmen."
@@ -108,7 +108,7 @@ class Filter:
homeassistant = self._matches( homeassistant = self._matches(
text, text,
( (
r"\bhome\s*assistant\b", r"\bhomeassistant\b", r"\bhass\b", r"\bhome\s*assist(?:ant|ent)\b", r"\bhomeassistant\b", r"\bhass\b",
r"\bautomatisierung(?:en)?\b", r"\bentit[aä]t(?:en)?\b", r"\bautomatisierung(?:en)?\b", r"\bentit[aä]t(?:en)?\b",
r"\b(?:sensor|light|switch|climate|automation)\.[\w.-]+", r"\b(?:sensor|light|switch|climate|automation)\.[\w.-]+",
r"\b(?:temperatur|luftfeuchtigkeit|wie warm)\b.*\b" r"\b(?:temperatur|luftfeuchtigkeit|wie warm)\b.*\b"
@@ -118,7 +118,7 @@ class Filter:
arr = self._matches( arr = self._matches(
text, text,
( (
r"\bsonarr\b", r"\bradarr\b", r"\barr[- ]mcp\b", r"\bsona(?:rr|r)?\b", r"\brada(?:rr|r)\b", r"\barr[- ]mcp\b",
r"\b(?:staffel|episode|folge)(?:n)?\b.*\b" r"\b(?:staffel|episode|folge)(?:n)?\b.*\b"
r"(?:fehl|such|download|indexer|release|serie)\w*", r"(?:fehl|such|download|indexer|release|serie)\w*",
r"\b(?:serie|film)\b.*\b(?:sonarr|radarr|indexer|release)\b", r"\b(?:serie|film)\b.*\b(?:sonarr|radarr|indexer|release)\b",
@@ -135,11 +135,13 @@ class Filter:
unraid = self._matches( unraid = self._matches(
text, text,
( (
r"\bunraid\b", r"\bhome\s*server\b", r"\bhomeserver\b", r"\b(?:unraid|unreid|unrate|anrate)\b", r"\bhome\s*server\b", r"\bhomeserver\b",
r"\bparity\b", r"\barray\b", r"\bmua\b", r"\bparity\b", r"\barray\b", r"\bmua\b",
r"\bdocker[- ]container\b", r"\bcontainer(?:n)?\b.*\b" r"\b(?:docker|doker|dacher)[- ]cont[aä]iner\b",
r"(?:docker|log|update|l[aä]uft|laufen|gestoppt|unraid)\b", r"\bcont[aä]iner(?:n)?\b.*\b"
r"\b(?:docker|container)\b.*\b(?:unraid|homeserver|nas)\b", r"(?:docker|doker|dacher|log|update|l[aä]uft|laufen|gestoppt|unraid)\b",
r"\b(?:docker|doker|dacher|cont[aä]iner)\b.*\b"
r"(?:unraid|unreid|unrate|anrate|homeserver|nas)\b",
), ),
) )
github = self._matches( github = self._matches(