IniziaInizia gratis

Multi-step prompt to plan a trip

You noticed that the single-step prompt was not effective, because the answer was too vague for what you had in mind. You improve your prompt by specifying the steps to follow for planning. The plan should have four potential locations for your beach vacation, and each location should have some accommodation options, some activities, and an evaluation of the pros and cons.

The OpenAI package and the get_response() function have been pre-loaded for you.

The get_response() function in this exercise employs the max_tokens parameter to help this exercise run faster. This may truncate your solution.

Questo esercizio fa parte del corso

Prompt Engineering with the OpenAI API

Visualizza il corso

Istruzioni dell'esercizio

  • Create a multi-step prompt asking the model to make a plan for a beach vacation, which should include: four potential locations, each with some accommodation options, some activities, and an evaluation of the pros and cons.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

client = OpenAI(api_key="")

# Create a prompt detailing steps to plan the trip
prompt = """____"""

response = get_response(prompt)
print(response)
Modifica ed esegui il codice