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)