vscode-copilot-release icon indicating copy to clipboard operation
vscode-copilot-release copied to clipboard

Encourage the model to produce valid markdown

Open pijvsk opened this issue 1 year ago • 2 comments

  • VS Code Version:
  • OS Version:
  • Logs:

Steps to Reproduce:

  1. question - 3m48s+32s+7m16s+19m45s =
  2. answers-
To add up the time, you first need to convert everything to the same unit. In this case, let's use seconds.

3m48s = 360 + 48 = 228 seconds 32s = 32 seconds 7m16s = 760 + 16 = 436 seconds 19m45s = 19*60 + 45 = 1185 seconds

Now, add all the seconds together:

228s + 32s + 436s + 1185s = 1881 seconds

To convert this back to minutes and seconds, divide by 60 and take the remainder:

1881 ÷ 60 = 31 minutes and 21 seconds

So, 3m48s + 32s + 7m16s + 19m45s = 31m21s.
image

it answers correctly, but the multiplication signs are interpreted as markdown formatting and the answer looks wrong

expecting -

3m48s = 3*60 + 48 = 228 seconds 32s = 32 seconds 7m16s = 7*60 + 16 = 436 seconds 19m45s = 19*60 + 45 = 1185 seconds

pijvsk avatar Jan 26 '24 10:01 pijvsk

Yes, we need to try to encourage the model to produce valid markdown with some more examples...

roblourens avatar Jan 26 '24 19:01 roblourens

This makes it nearly impossible to get it to write a README.md file for you. Should be something it would be good at, explaining and documenting usually work well. But since it can't do nested code blocks correctly, the content can be good but isn't very useful.

Invoking inline doesn't appear to be able to read the rest of the workspace, so while it can write into the editor it can't see enough context. It would be nice if chat could write directly to files.

zeel01 avatar Sep 19 '24 06:09 zeel01

Workaround:

Write your answer in markdown format enclosed between "```". 😄 

abdes avatar Nov 13 '24 11:11 abdes

This makes it nearly impossible to get it to write a README.md file for you. Should be something it would be good at, explaining and documenting usually work well. But since it can't do nested code blocks correctly, the content can be good but isn't very useful.

Invoking inline doesn't appear to be able to read the rest of the workspace, so while it can write into the editor it can't see enough context. It would be nice if chat could write directly to files.

@zeel01 Have you tried Copilot Edits? This scenario should work well there

joyceerhl avatar Dec 12 '24 18:12 joyceerhl

used this prompt to generate the README.md content in a JSON format and then utilized it.

Here’s an example of the prompt and its use in Node.js or a browser developer console:

// Prompt
// Can you provide the README.md content in JSON format, such as:
// { "readme": "## Installation\n ..." }

// Response
const response = { "readme": "## Installation\n ..." };

// Usage
console.log(response.readme); // Outputs: ## Installation\n ...

The Result:

# URL Checker

This project is designed to fetch URLs from sitemaps, check their availability, and log any errors encountered during the process.

## Project Structure

resatarikan avatar Dec 18 '24 23:12 resatarikan

used this prompt to generate the README.md content in a JSON format and then utilized it.

Here’s an example of the prompt and its use in Node.js or a browser developer console:

// Prompt // Can you provide the README.md content in JSON format, such as: // { "readme": "## Installation\n ..." }

// Response const response = { "readme": "## Installation\n ..." };

// Usage console.log(response.readme); // Outputs: ## Installation\n ... The Result:

URL Checker

This project is designed to fetch URLs from sitemaps, check their availability, and log any errors encountered during the process.

Project Structure

Piggy backing off the above suggestion.

I used this prompt Can you provide the requested updates for the README.md content in JSON format, such as: { "readme": "## Installation\n ..." }

And then I copied/inserted the output into a .jsonc file. and used this inline prompt to convert to MD.

Can you convert this JSON to MD and for any code blocks use <code> instead of ```

Once converted to MD, I was able to do a find and replace of and , which was replaced with ```

ctm8788 avatar Mar 03 '25 14:03 ctm8788