Как вернуть изображение в качестве ответа в Django
Делаю POST запрос к GPT-3, чтобы получить вывод завершения кода, когда я посылаю некоторый ввод.
Я, похоже, получаю ожидаемый ответ, но не могу получить код, написанный GPT-3. Вот какой ответ я получаю:
".\n\n## Challenge\n\nWrite a function called `preOrder` which takes a binary tree as its only input. Without utilizing
any of the built-in methods available to your language, return an array of the values, ordered from left to right as
they would be if the tree were represented by a pre-order traversal.\n\n## Approach & Efficiency\n\nI used a recursive
approach to solve this problem. I created a function called `preOrder` that takes in a binary tree as its only input. I
then created a variable called `output` that is an empty array. I then created a function called `_walk` that takes in a
node as its only input. I then created a base case that checks if the node is null. If it is, it returns. If it is not,
it pushes the value of the node into the `output` array. It then recursively calls the `_walk` function on the left and
right nodes of the node. It then returns the `output` array.\n\n## Solution\n\n![Whiteboard](./assets/pre-order.jpg)"
Я предполагаю, что фактически написанный код относится к заголовку Solution, но не могу понять, как получить и просмотреть это изображение, т.е. если я просто возвращаю ссылку на изображение, ничего не открывается.
UPDATE. Я предполагаю, что этот ответ является уценкой, и использовал парсер уценки, чтобы вернуть ответ в виде уценки, и вот что я получил:
<p>.</p>
<h2>Challenge</h2>
<p>Write a function called <code>preOrder</code> which takes a binary tree as its only input. Without utilizing any of
the built-in methods available to your language, return an array of the values, ordered from left to right as they
would be if you traversed the tree using a pre-order traversal.</p>
<h2>Solution</h2>
<p><img alt="" src="./assets/pre-order.jpg" /></p>