From 2599a574e1f90cab24c775866ce627d0e0fd30f5 Mon Sep 17 00:00:00 2001 From: "Bernd (Hermes)" Date: Fri, 19 Jun 2026 19:53:59 +0200 Subject: [PATCH] =?UTF-8?q?fix(classifier):=20wrap=20sync=20generate()=20i?= =?UTF-8?q?n=20asyncio.to=5Fthread()=20=E2=80=94=20remove=20broken=20await?= =?UTF-8?q?=20on=20non-coroutine?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/archivar/classifier.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugin/archivar/classifier.py b/plugin/archivar/classifier.py index 01d14cc..0ab42c2 100644 --- a/plugin/archivar/classifier.py +++ b/plugin/archivar/classifier.py @@ -488,8 +488,7 @@ class IntentClassifier: Intent-Kategorien. Uses ``LLMClient.generate()`` for free-form output. Used by the router for LLM_ROOM_PROMPT. - Uses ``asyncio.to_thread()`` because ``LLMClient.generate()`` is - synchronous. + Wraps synchronous OllamaLLMClient.generate() in asyncio.to_thread(). Args: prompt: The complete prompt to send. @@ -497,10 +496,10 @@ class IntentClassifier: Returns: The LLM's response text (stripped), or None on failure. """ + import asyncio try: if not self._llm_client or not self._llm_enabled: return None - import asyncio return await asyncio.to_thread(self._llm_client.generate, prompt) except Exception as e: logger.warning("LLM raw call failed: %s", e)