diff --git a/home/bilbo_churn.py b/home/bilbo_churn.py index 9db4010..def810f 100644 --- a/home/bilbo_churn.py +++ b/home/bilbo_churn.py @@ -59,8 +59,25 @@ def ollama_worker(): response = f"Churning... status {resp.status_code}" except Exception as e: - # System overloaded - send churn message - response = f"*adjusts spectacles* The system churns at maximum, you see. My thoughts come slowly when Bag End is so crowded. But they DO come. Thank you very much for your patience." + # System overloaded - try quick generation or fail honestly + try: + # One last try with minimal prompt + quick_resp = requests.post( + f"{OLLAMA_HOST}/api/generate", + json={ + "model": "qwen2.5:1.5b", + "prompt": "Bilbo is exhausted but polite. Respond briefly.", + "stream": False, + "options": {"num_predict": 30} + }, + timeout=10 + ) + if quick_resp.status_code == 200: + response = quick_resp.json()["response"].strip() + else: + response = "Oh dear... I'm a bit overwhelmed. One moment please." + except: + response = "The system churns... I'm here, just slow." # Send response try: