diff --git a/matrixbot/commands.py b/matrixbot/commands.py index 49410ee..a548e2a 100644 --- a/matrixbot/commands.py +++ b/matrixbot/commands.py @@ -937,7 +937,7 @@ async def _generate_trivia_question(category: str) -> dict | None: "The question should be clear, factual, and have exactly one correct answer." ) try: - timeout = aiohttp.ClientTimeout(total=20) + timeout = aiohttp.ClientTimeout(total=60) async with aiohttp.ClientSession(timeout=timeout) as session: async with session.post( f"{OLLAMA_URL}/api/chat", @@ -1237,7 +1237,7 @@ async def _generate_hangman_word() -> dict | None: ) user_msg = "Pick a common English word between 5 and 8 letters (lowercase letters only, no hyphens or spaces) and give a short hint." try: - timeout = aiohttp.ClientTimeout(total=20) + timeout = aiohttp.ClientTimeout(total=60) async with aiohttp.ClientSession(timeout=timeout) as session: async with session.post( f"{OLLAMA_URL}/api/chat", @@ -1444,7 +1444,7 @@ async def _generate_scramble_word() -> dict | None: ) user_msg = "Pick a common English word between 4 and 8 letters (lowercase letters only, no hyphens or spaces)." try: - timeout = aiohttp.ClientTimeout(total=20) + timeout = aiohttp.ClientTimeout(total=60) async with aiohttp.ClientSession(timeout=timeout) as session: async with session.post( f"{OLLAMA_URL}/api/chat", @@ -1566,7 +1566,7 @@ async def _generate_wyr() -> dict | None: ) user_msg = "Generate a fun, creative Would You Rather question. Keep each option under 10 words." try: - timeout = aiohttp.ClientTimeout(total=20) + timeout = aiohttp.ClientTimeout(total=60) async with aiohttp.ClientSession(timeout=timeout) as session: async with session.post( f"{OLLAMA_URL}/api/chat", @@ -1664,7 +1664,7 @@ async def _generate_riddle() -> dict | None: ) user_msg = "Generate a clever riddle. The answer should be 1-4 words." try: - timeout = aiohttp.ClientTimeout(total=20) + timeout = aiohttp.ClientTimeout(total=60) async with aiohttp.ClientSession(timeout=timeout) as session: async with session.post( f"{OLLAMA_URL}/api/chat", @@ -1876,7 +1876,7 @@ async def _generate_story_opener() -> str | None: "Just the opening sentence, no explanation or title." ) try: - timeout = aiohttp.ClientTimeout(total=20) + timeout = aiohttp.ClientTimeout(total=60) async with aiohttp.ClientSession(timeout=timeout) as session: async with session.post( f"{OLLAMA_URL}/api/generate",