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.
Bu egzersiz
Prompt Engineering with the OpenAI API
kursunun bir parçasıdırEgzersiz talimatları
- Craft a chain-of-thought prompt that asks the model to explain the provided
function.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
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)