From fd64f88a7edabf52721c267f58d9bfe8838674ee Mon Sep 17 00:00:00 2001 From: lanvent Date: Tue, 28 Mar 2023 22:18:29 +0800 Subject: [PATCH] fix: import openai.error --- bot/chatgpt/chat_gpt_bot.py | 2 +- bot/openai/open_ai_bot.py | 1 + bot/openai/open_ai_image.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bot/chatgpt/chat_gpt_bot.py b/bot/chatgpt/chat_gpt_bot.py index 1fdae65..9d6c4c1 100644 --- a/bot/chatgpt/chat_gpt_bot.py +++ b/bot/chatgpt/chat_gpt_bot.py @@ -11,8 +11,8 @@ from common.log import logger from common.token_bucket import TokenBucket from common.expired_dict import ExpiredDict import openai +import openai.error import time - # OpenAI对话模型API (可用) class ChatGPTBot(Bot,OpenAIImage): def __init__(self): diff --git a/bot/openai/open_ai_bot.py b/bot/openai/open_ai_bot.py index fde673d..b039987 100644 --- a/bot/openai/open_ai_bot.py +++ b/bot/openai/open_ai_bot.py @@ -9,6 +9,7 @@ from bridge.reply import Reply, ReplyType from config import conf from common.log import logger import openai +import openai.error import time user_session = dict() diff --git a/bot/openai/open_ai_image.py b/bot/openai/open_ai_image.py index 4fa02de..2fae243 100644 --- a/bot/openai/open_ai_image.py +++ b/bot/openai/open_ai_image.py @@ -1,5 +1,6 @@ import time import openai +import openai.error from common.token_bucket import TokenBucket from common.log import logger from config import conf