Open goxofy opened 7 months ago
openai库有超时参数:https://github.com/openai/openai-python/blob/main/src/openai/_client.py#L49 ,在config里添加timeout配置,应该是可以的:
class ChatGPTBot:
def __init__(self):
openai.api_key = conf().get("openai_api_key")
api_base = conf().get("openai_api_base")
proxy = conf().get("proxy")
if api_base:
openai.api_base = api_base
if proxy:
openai.proxy = proxy
self.name = self.__class__.__name__
self.args = {
"model": conf().get("model"),
"temperature": conf().get("temperature"),
"timeout": conf().get("timeout"), # 这里添加了timeout参数
}
Search for answers in existing issues
Feature description
No response
Motivation
No response