From 36ed6f0a953752e99ab7e1aac3d1db8247aecb4f Mon Sep 17 00:00:00 2001 From: Cyberes Date: Sun, 19 Mar 2023 15:15:12 -0600 Subject: [PATCH] api timeout --- matrix_gpt/bot/chat_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matrix_gpt/bot/chat_functions.py b/matrix_gpt/bot/chat_functions.py index 49fed9e..e2f1de6 100644 --- a/matrix_gpt/bot/chat_functions.py +++ b/matrix_gpt/bot/chat_functions.py @@ -196,7 +196,7 @@ async def process_chat( if index != -9999: messages.insert(index, {"role": "system", "content": injected_system_prompt}) - response = openai_obj.ChatCompletion.create(model=openai_model, messages=messages, temperature=0) + response = openai_obj.ChatCompletion.create(model=openai_model, messages=messages, temperature=0, timeout=10) text_response = response["choices"][0]["message"]["content"].strip().strip('\n') # Logging stuff