Writing improvement
A popular online community relies on user-generated content to thrive. Users frequently contribute reviews, articles, and comments, but the quality of these contributions varies. To elevate the overall experience for its members, the community aims to enhance user-generated texts. This includes fixing grammar errors and refining writing tones to create a more polished and engaging environment for all users. Your task is to build a multi-step prompt that proofreads and adjusts the tone of a given text.
The OpenAI package, the text string to operate on, and the get_response() function have been pre-loaded for you.
Latihan ini adalah bagian dari kursus
Prompt Engineering with the OpenAI API
Petunjuk latihan
- Craft a multi-step prompt that first proofreads the text without changing its structure, and then adjusts its tone to be formal and friendly.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
client = OpenAI(api_key="")
# Craft a prompt to transform the text
prompt = ____
response = get_response(prompt)
print("Before transformation:\n", text)
print("After transformation:\n", response)