feat: chatGPT bot

This commit is contained in:
zhayujie
2022-12-10 13:15:31 +08:00
parent 1ec0a530bf
commit a059005506
7 changed files with 37 additions and 7 deletions

View File

@@ -1,6 +1,5 @@
# encoding:utf-8
import json
import requests
from bot.bot import Bot
@@ -17,8 +16,8 @@ class BaiduUnitBot(Bot):
return response.json()['result']['context']['SYS_PRESUMED_HIST'][1]
def get_token(self):
access_key = '${YOUR_ACCESS_KEY}'
secret_key = '${YOUR_SECRET_KEY}'
access_key = 'wdNwpvzh4fBr8xzTuPePOWhU'
secret_key = 'EUtLXyrogfTQV8nnjncnqNEfeyoHDUqS'
host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id=' + access_key + '&client_secret=' + secret_key
response = requests.get(host)
if response: