update app_chatgpt: get_openai

This commit is contained in:
Chill
2024-04-01 15:47:31 +08:00
parent 6f1b1cb1d6
commit ab34243fe9
5 changed files with 22 additions and 65 deletions

View File

@@ -312,10 +312,11 @@ class Channel(models.Model):
# if msg_len * 2 >= 8000:
# messages = [{"role": "user", "content": msg}]
if sync_config == 'sync':
self.get_ai_response(ai, messages, channel, user_id, message)
else:
self.with_delay().get_ai_response(ai, messages, channel, user_id, message)
self.get_ai_response(ai, messages, channel, user_id, message)
# if sync_config == 'sync':
# self.get_ai_response(ai, messages, channel, user_id, message)
# else:
# self.with_delay().get_ai_response(ai, messages, channel, user_id, message)
except Exception as e:
raise UserError(_(e))