gpt3: fix timeout bug

This commit is contained in:
dece 2022-12-12 15:54:38 +01:00
parent 2f868d2389
commit f4ece3b5e0

View file

@ -37,9 +37,10 @@ class Gpt3Plugin(Plugin):
frequency_penalty=0.5, frequency_penalty=0.5,
presence_penalty=0, presence_penalty=0,
timeout=30, timeout=30,
response_timeout=30, request_timeout=30,
) )
except openai.error.OpenAIError: except openai.error.OpenAIError as exc:
self.bot.log_e(f"OpenAI error: {exc}")
return None return None
return completion.choices[0].text return completion.choices[0].text