AgentGPT icon indicating copy to clipboard operation
AgentGPT copied to clipboard

🐛 Fix code formatting

Open asim-shrestha opened this issue 2 years ago • 8 comments

image

We use a markdown formatter for code formatting. In cases where the provided text from GPT is

" {CODE}" instead of "python{CODE}" no formatting is used. We should still have a default display that shows it is code and not just a regular string.

asim-shrestha avatar Apr 19 '23 18:04 asim-shrestha

I can work on this either tonight or tomorrow morning

matthope1 avatar Apr 19 '23 22:04 matthope1

Awesome! Assigned you :)

asim-shrestha avatar Apr 20 '23 17:04 asim-shrestha

Hey I also wanted to contribute to this feature.

rp-bot avatar Apr 20 '23 17:04 rp-bot

@asim-shrestha or @reworkd-admin Does anyone have a text example from chatgpt where the formatting is displayed correctly? In my testing the formatting has never worked & code is always displayed as a string.

image

matthope1 avatar Apr 20 '23 19:04 matthope1

@matthope1 I got this.

prompt: write a simple python script.

  1. image
  2. image
  3. image

rp-bot avatar Apr 20 '23 23:04 rp-bot

@rp-bot woulsnyou be able to share your code for this?

awtkns avatar Apr 21 '23 09:04 awtkns

@rp-bot Did you initiate PR? Would love to see what you did there.

raj2033 avatar Apr 21 '23 16:04 raj2033

I haven't made a PR yet

rp-bot avatar Apr 21 '23 17:04 rp-bot

Has been fixed! Codeformatting now displays like so:

image

asim-shrestha avatar May 10 '23 23:05 asim-shrestha