Nashex / gpt4-playground

Clone of OpenAI's ChatGPT and Playground environments to enable experimenting with API keys.
https://www.gpt4-playground.com/
MIT License
352 stars 116 forks source link

Markdown tables not supported #9

Closed othmanelhoufi closed 1 year ago

othmanelhoufi commented 1 year ago

Hello again,

I noticed that when I ask the model for a markdown table the output is in text and it doesn't format to a table structure.

Example:

Here is a table in Markdown format with the top 5 countries and their fictional security levels:

"| Rank | Country     | Security Level |
|------|-------------|----------------|
| 1    | Switzerland | Very High      |
| 2    | Denmark     | Very High      |
| 3    | Finland     | Very High      |
| 4    | Sweden      | High           |
| 5    | Norway      | High           |"

the output should be like an actual table (visually)

phookycom commented 1 year ago

Formatted tables are a special feature of Github mardown. You can add it by using the package "remark-gfm" in 3 easy steps:

In the package.json add the following package: "remark-gfm":"^3.0.1"

In the file "AssistantMessageContent.tsx" import the package: import remarkGfm from 'remark-gfm';

Then activate the package under remarkPlugins={[remarkMath, remarkGfm]}

othmanelhoufi commented 1 year ago

It works like a charm, thanks @phookycom I hope you can help me with the previous issue too 👍🏼