Exploring prompt engineering
Prompt engineering refers to crafting effective prompts to guide the language model towards the intended response. By refining your prompts, you can achieve better results and guide the model towards generating more accurate and useful responses. Your task in this exercise is to modify the prompt you used in the previous exercise.
The OpenAI
package and the get_response()
function have been pre-loaded for you.
This exercise is part of the course
ChatGPT Prompt Engineering for Developers
Exercise instructions
- Craft a
prompt
that asks the model to generate a poem about ChatGPT while ensuring that it is written in basic English that a child can understand. - Get the
response
using theget_response()
function.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
client = OpenAI(api_key="")
# Craft a prompt that follows the instructions
prompt = "____"
# Get the response
response = ____
print(response)