Added timeout to LLM API
Browse files
chatbot/agentic_rag/agent.py
CHANGED
|
@@ -108,6 +108,7 @@ def run_reasoning_agent(question: str, max_steps: int = 8):
|
|
| 108 |
model="Qwen/Qwen3-4B-Instruct-2507",
|
| 109 |
max_tokens=1024,
|
| 110 |
temperature=0.1,
|
|
|
|
| 111 |
stop=["Observation:", "Observation"]
|
| 112 |
)
|
| 113 |
except Exception as e:
|
|
|
|
| 108 |
model="Qwen/Qwen3-4B-Instruct-2507",
|
| 109 |
max_tokens=1024,
|
| 110 |
temperature=0.1,
|
| 111 |
+
timeout=30, # Prevent infinite hanging if Hugging Face is slow
|
| 112 |
stop=["Observation:", "Observation"]
|
| 113 |
)
|
| 114 |
except Exception as e:
|