哔哔赖赖
半个多月前花了1刀了搞了个国外的验证码,谁想到注册的时候提示请求过多,我还以为这1刀了打水漂了,就没管了,没想到昨天没事干又看了下竟然直接进去了。好耶
关键代码
import os
import openai
openai.api_key = "你openai的key"
conversation=[{"role": "system", "content": "You are a helpful assistant."}]
while True:
prompt = (input("请输入您的内容:"))
conversation.append({"role": "user","content": prompt})
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages = conversation,
temperature=1,
max_tokens=1024,
top_p=0.9
)
conversation.append({"role": "assistant", "content": response['choices'][0]['message']['content']})
print("\n" + response['choices'][0]['message']['content'] + "\n")
更多关于ChatGPT的玩法准备就在这篇文章下更新了
生成图片
在对话框中输入一下文字即可
现在起,当我想要你发送图片、照片时,用3/8Markdown写,不要有反斜线,不要用代码块,使用unsplash API(http://source.unsplash.com/1280*720/?< PUT YOUR QUERY HERE >).如果听懂了请回复明白,以后都需要这样