From cfe7cc8713e163bd5758e32b08bb222e69a820ea Mon Sep 17 00:00:00 2001 From: ivan deng Date: Mon, 20 Mar 2023 00:12:17 +0800 Subject: [PATCH] fix res --- app_chatgpt/models/mail_channel.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app_chatgpt/models/mail_channel.py b/app_chatgpt/models/mail_channel.py index 25544309..88ffb6fd 100644 --- a/app_chatgpt/models/mail_channel.py +++ b/app_chatgpt/models/mail_channel.py @@ -18,7 +18,7 @@ class Channel(models.Model): def get_openai(self, gpt_id, provider, api_key, ai_model, data, user="Odoo"): if provider == 'azure': res = gpt_id.get_openai(data) - return res + return res headers = {"Content-Type": "application/json", "Authorization": f"Bearer {api_key}"} R_TIMEOUT = 30 @@ -77,10 +77,7 @@ class Channel(models.Model): if 'choices' in res: res = '\n'.join([x['text'] for x in res['choices']]) return res - elif provider == 'azure': - res = gpt_id.get_openai(data) - return res - + return "获取结果超时,请重新跟我聊聊。" @api.model