AI Prompt Engineering: Difference between revisions
Jump to navigation
Jump to search
→Convert the response to json
Tags: Mobile edit Mobile web edit |
Tags: Mobile edit Mobile web edit |
||
| Line 59: | Line 59: | ||
Human: 分析底下這句話,直接以 JSON 回傳抓取到的資訊 ,包含 出發站(Departure)、到達站(arrival)、票種(TickeType)、數量 (Amount)、出發時間 (DepartureTime)。•我爱從台北到高雄的自由座三張,下午1:30出發。還有爾張優待票,去合中的,2:30出發 | Human: 分析底下這句話,直接以 JSON 回傳抓取到的資訊 ,包含 出發站(Departure)、到達站(arrival)、票種(TickeType)、數量 (Amount)、出發時間 (DepartureTime)。•我爱從台北到高雄的自由座三張,下午1:30出發。還有爾張優待票,去合中的,2:30出發 | ||
AI: { "Departure": "Taipei", "Arrival": "Kaohsiung", "TicketType": "Freedom Seats", "Amount": 3, "DepartureTime": "1:30 PM" }, { "TicketType": "Discounted", "Departure": "Hecheng", "DepartureTime": "2:30 PM" } | AI: { "Departure": "Taipei", "Arrival": "Kaohsiung", "TicketType": "Freedom Seats", "Amount": 3, "DepartureTime": "1:30 PM" }, { "TicketType": "Discounted", "Departure": "Hecheng", "DepartureTime": "2:30 PM" } | ||
</pre> | |||
== Structure the Reply in Nested JSON Format == | |||
Desired format: | |||
<pre> | |||
{ | |||
"output": { | |||
"keywords": ["keyword1", "keyword2", "keyword3", "..."], | |||
"summary": "A concise overview that captures the key elements and core ideas of the subject." | |||
} | |||
} | |||
</pre> | |||
The prompt: | |||
<pre> | |||
Organize the response in a JSON structure. Use the primary key "output" that encompasses two nested keys: "keywords" and "points". Additionally, include a "summary" under the "output" key. | |||
</pre> | </pre> | ||