Extracting the response
The data analytics AI assistant must return clean and readable responses to users, and the company has asked you to extract only the relevant text from the model's response.
Extract and print only the generated text from the pre-imported Llama's response
.
Diese Übung ist Teil des Kurses
Working with Llama 3
Anleitung zur Übung
- Extract the
"text"
from the first element of the"choices"
list inresponse
and store it inextracted
. - Print
extracted
.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Extract the first choice and generated text
extracted = response["choices"]____
# Print the extracted text
print(____)