mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
[18] app_chatgpt, model_list
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
{
|
||||
'name': 'ChatGPT4, China Ali,AiGC Center.Ai服务中心,聚合全网Ai',
|
||||
'version': '18.0.25.01.08',
|
||||
'version': '18.0.25.02.10',
|
||||
'author': 'odooai.cn',
|
||||
'company': 'odooai.cn',
|
||||
'maintainer': 'odooai.cn',
|
||||
|
||||
@@ -234,6 +234,7 @@ GPT-3 A set of models that can understand and generate natural language
|
||||
|
||||
def get_ai_list_model(self):
|
||||
self.ensure_one()
|
||||
if self.provider == 'openai':
|
||||
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {self.openapi_api_key}"}
|
||||
R_TIMEOUT = self.ai_timeout or 120
|
||||
o_url = "https://api.openai.com/v1/models"
|
||||
@@ -246,6 +247,8 @@ GPT-3 A set of models that can understand and generate natural language
|
||||
r_text = json.dumps(res, indent=2)
|
||||
else:
|
||||
r_text = 'No response.'
|
||||
else:
|
||||
r_text = 'No response.'
|
||||
raise UserError(r_text)
|
||||
|
||||
def get_openai(self, data, author_id, answer_id, param={}):
|
||||
|
||||
Reference in New Issue
Block a user