Working with pre tag and code tag (python) with API response

Hi,
I built a local server using flask, when I send an API request relates to a python code the completion comes with a code tag,
I didn’t find a way to make the code response to be in a code or pre tag, and the explanation outside of it.
I tried to use bs4 and request but it seems to work only with static sites
How can I make it work so the code will be in a code\pre block and the explanation will be outside of it?

I hope I manage to explain myself.

Thank you!

Hi @liranhovav

You can instruct the model (in your prompt) to wrap the code block in the tags you want.

That is how I do it, at least.

HTH

Hi,

How do you instruct it?

You simply ask for the formatting you wish in your prompt.

Try it :slight_smile:

Thank you for the tip - I’ll indeed try it! :slight_smile: