ChatGPT插件例子 转弯方向
将自然语言转换为逐向指示。
提问
根据以下文本创建一个带编号的转弯指示列表:
沿 95 号公路向南行驶,直到到达 Sunrise boulevard,然后向东行驶至 us 1,然后向南行驶。几英里后,Tom Jenkins bbq 将在左侧。
回答
1. 沿 95 号公路向南行驶
2. 沿 Sunrise Boulevard 向东行驶
3. 沿 US 1 向南行驶
4. Tom Jenkins BBQ 将在几英里后的左侧
API请求
import os
import openai
openai.api_key = os.getenv("OPENAI_API_KEY")
response = openai.Completion.create(
model="text-davinci-003",
prompt="Create a numbered list of turn-by-turn directions from this text: \n\nGo south on 95 until you hit Sunrise boulevard then take it east to us 1 and head south. Tom Jenkins bbq will be on the left after several miles.",
temperature=0.3,
max_tokens=64,
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.0
)