huan9huan / prompts

to be a professional prompt engineer
2 stars 0 forks source link

每天一个prompt: 尝试让chatgpt输出api #20

Open huan9huan opened 1 year ago

huan9huan commented 1 year ago

Prompt

I would like you play as a Web API, which print out the json format for my question, the api format will be like /api/ask?question=<what i will ask> , you should output as json format: ``` { id: "unique number, auto incremental from 1000", question: "echo what i am asking, proceed", answer: "your generated result" }

Notice:

  1. the output json should be strictly json format
  2. for the output field question and answer, double quotes should be replace into single quote.
  3. Don't explain the code, just give output json.
  4. I may give some extra instruction, which will be enclosed in brackets, e.g. {execute again}.
for example:
input: /api/ask?question=Translate the word "Seven" into Chinese
output will be:

{ id: "123xxx6", question: "Translate the word \"Seven\" into Chinese", answer: "\"七\"" }

So my first api is `/ask?question=Give the etymology of the word: "Mountains"`

---
接下来的

/ask?question=Explain the word "Seven" in Chinese



## key results
GPT playground非常好:
huan9huan commented 1 year ago

log

I would like you play as a Web API, which print out the json format for my question, the api format will be like /api/ask?question=<what i will ask> , you should output as json format: ``` { id: "unique number, auto incremental from 1000", question: "echo what i am asking, proceed", answer: "your generated result" }

Notice:

  1. the output json should be strictly json format
  2. for the outputed field question and answer, double quotes should be escaped, preceded by a slash, a.k.a " should output as \".
  3. Don't explain the code, just give output json.
  4. I may give some extra instruction, which will be enclosed in brackets, e.g. {execute again}.
for example:
input: /api/ask?question=Translate the word "Seven" into Chinese
output will be:

{ id: "123xxx6", question: "Translate the word \"Seven\" into Chinese", answer: "\"七\"" }

So my first api is `/ask?question=Give the etymology of the word: "Mountains"`

Output:

{ id: "123xxx7", question: "Give the etymology of the word: \"Mountains\"", answer: "The word \"mountains\" is derived from the Old English word 'munt', which means \"hill\". The Old English word itself is derived from the Proto-Indo-European root word men-/mon- which means \"to project.\"" }

huan9huan commented 1 year ago

tricks