From 8eaed229b4d30b9ed91ba2920da3ed4b03ad13de Mon Sep 17 00:00:00 2001 From: "majiahui@haimaqingfan.com" Date: Fri, 7 Apr 2023 18:05:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A4=9Aip=E5=A4=9A=E7=AF=87?= =?UTF-8?q?=E5=B9=B6=E5=8F=91flask?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chatgpt_post.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/chatgpt_post.py b/chatgpt_post.py index ca3d5da..4fe7864 100644 --- a/chatgpt_post.py +++ b/chatgpt_post.py @@ -33,24 +33,3 @@ print(res["choices"][0]["message"]["content"]) -OPENAI_API_KEY = api_key - - url = "https://api.openai.com/v1/chat/completions" - headers = { - "Content-Type": "application/json", - "Authorization": f"Bearer {OPENAI_API_KEY}" - } - data = { - "model": "gpt-3.5-turbo", - "messages": [ - {"role": "user", "content": "请帮我改写这句话:在城市发展进程当中,逐渐呈现出一些综合性的大型建筑群。"}, - {"role": "assistant", "content": "随着城市的发展,综合性大型建筑群正在逐渐出现。"}, - {"role": "user", "content": "这句话我不满意,再改一下帮我"} - ], - "temperature": 0.7 - } - response = requests.post(url, - headers=headers, - data=json.dumps(data), - timeout=1000) - redis_.rpush(redis_key_name_openaikey_list, api_key) \ No newline at end of file