IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Prompt Engineering with the OpenAI API

Visualizza il corso

Istruzioni dell'esercizio

  • Craft a multi-step prompt that first proofreads the text without changing its structure, and then adjusts its tone to be formal and friendly.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

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)
Modifica ed esegui il codice