prepare app_chatgpt 17.0

This commit is contained in:
Chill
2024-03-07 18:19:45 +08:00
parent 00bb10fd3b
commit 684b775f7c
9 changed files with 43 additions and 54 deletions

View File

@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import openai.openai_object
# import openai.openai_object
import openai
import requests, json
import openai
import base64
@@ -173,7 +174,7 @@ GPT-3 A set of models that can understand and generate natural language
def get_ai_post(self, res, author_id=False, answer_id=False, param={}):
# hook高级版要替代
if res and author_id and isinstance(res, openai.openai_object.OpenAIObject) or isinstance(res, list) or isinstance(res, dict):
if res and author_id and type(res) == openai.Completion or isinstance(res, list) or isinstance(res, dict):
# 返回是个对象那么就是ai
# if isinstance(res, dict):
if self.provider == 'openai':