ChatGPT插件例子 命令文本
将文本转换为编程命令。
提问:
将此文本转换为编程命令:
问康斯坦斯我们是否需要一些面包
输出:发送消息“寻找康斯坦斯”我们需要一些面包吗?
去滑雪商店看看我是否能在周四离开前把滑雪板修好
回答:
发送消息“查找滑雪商店”我可以在周四离开前把滑雪板修好吗?
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(
model="text-davinci-003",
prompt="Convert this text to a programmatic command:\n\nExample: Ask Constance if we need some bread\nOutput: send-msg `find constance` Do we need some bread?\n\nReach out to the ski store and figure out if I can get my skis fixed before I leave on Thursday",
temperature=0,
max_tokens=100,
top_p=1.0,
frequency_penalty=0.2,
presence_penalty=0.0,
stop=["\n"]
)