Extract code from Text gpt response

I just tell the assistant exactly what I want by appending more instructions:

{ role: “user”, content: ${instruction}. Only respond with code as plain text without code block syntax around it. },

1 Like