I’m trying to prompt chatgpt to return a list of 20 beaches given a city name, like “Toronto”. If the city is not known for good beaches, I want it to simply return “no”.
I’ve tried many different prompts, but I seem to be sometimes getting a list of beaches and sometimes “no”, even when using the same city.
How can I prompt chatgpt’s API to return a list of beaches given a city name only if it has good beaches, otherwise just return “no”?
I’ve tried:
'messages' => [
[
"role" => "system",
"content" => "You are a travel assistant, helping a tourist find the best places to visit."
],
[
"role" => "user",
"content" => 'Does Toronto have any good beaches? You MUST respond with either "yes" or "no".'
],
[
"role" => "user",
"content" => "List up to 20 beaches in Toronto, in order of popularity. Output the result in one line, separated by commas without numbers."
],
],
As a second question, how can I prompt chatgpt to return as many popular beaches as it can given a city name, without supplying a specific amount, like 20?