ChatGPT插件例子 微型恐怖故事创作者
根据主题输入创建两到三句话的简短恐怖故事。
提问
主题:早餐
两句恐怖故事:当我把牛奶倒在他的麦片上时,他总是不哭。我只需要记住不要让他看到他在纸箱上的脸。
题目:风
两句恐怖故事:
回答
狂风呼啸着划破夜空,带着一股阴森森的力量摇晃着房子的窗户。当我走出去时,我能感觉到它在呼唤我,召唤我跟随它那令人不寒而栗的道路。
API请求
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(
model="text-davinci-003",
prompt="Topic: Breakfast\nTwo-Sentence Horror Story: He always stops crying when I pour the milk on his cereal. I just have to remember not to let him see his face on the carton.\n \nTopic: Wind\nTwo-Sentence Horror Story:",
temperature=0.8,
max_tokens=60,
top_p=1.0,
frequency_penalty=0.5,
presence_penalty=0.0
)