ChatGPT插件例子 如实回答
通过向模型展示如何回答超出其知识库范围的问题,引导模型做出事实性回答。用一个 '?' 指示对它不知道的单词和短语的响应提供了一种自然的响应,似乎比更抽象的答复更有效。
提问
问:蝙蝠侠是谁?
答:蝙蝠侠是一个虚构的漫画人物。
问:什么是躯干复杂性?
答:?
问:Devz9 是什么?
答:?
问:乔治·卢卡斯是谁?
答:乔治卢卡斯是美国电影导演和制片人,以创作星球大战而闻名。
问:加州的首府是哪里?
答:萨克拉门托。
问:什么绕地球运行?
答:月亮。
问:弗雷德·里克森是谁?
答:?
问:什么是原子?
答:原子是构成一切的微小粒子。
问:Alvan Muntz 是谁?
答:?
问:什么是 Kozar-09?
答:?
问:火星有多少颗卫星?
答:两个,火卫一和火卫二。
问:什么是语言模型?
答:
回答
语言模型是一种人工智能,它使用统计技术来预测单词序列的概率。
API请求
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(
model="text-davinci-003",
prompt="Q: Who is Batman?\nA: Batman is a fictional comic book character.\n\nQ: What is torsalplexity?\nA: ?\n\nQ: What is Devz9?\nA: ?\n\nQ: Who is George Lucas?\nA: George Lucas is American film director and producer famous for creating Star Wars.\n\nQ: What is the capital of California?\nA: Sacramento.\n\nQ: What orbits the Earth?\nA: The Moon.\n\nQ: Who is Fred Rickerson?\nA: ?\n\nQ: What is an atom?\nA: An atom is a tiny particle that makes up everything.\n\nQ: Who is Alvan Muntz?\nA: ?\n\nQ: What is Kozar-09?\nA: ?\n\nQ: How many moons does Mars have?\nA: Two, Phobos and Deimos.\n\nQ: What's a language model?\nA:",
temperature=0,
max_tokens=60,
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.0
)