Explaining code step by step
As a financial analyst at a consulting firm, you're tasked with analyzing investment portfolios and providing insights to clients. While reviewing a set of financial data files, you come across a Python function that seems related to analyzing portfolios, but you're unsure of its exact purpose. You decide to use chain-of-thought prompting to let the language model decipher it step by step.
The OpenAI package, the function string, 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 chain-of-thought prompt that asks the model to explain the provided
function.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
client = OpenAI(api_key="")
# Craft a chain-of-thought prompt that asks the model to explain what the function does
prompt = ____
response = get_response(prompt)
print(response)