Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Markdown render in playground chat #3456

Open
codenprogressive opened this issue Aug 20, 2024 · 2 comments
Open

Enhance Markdown render in playground chat #3456

codenprogressive opened this issue Aug 20, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@codenprogressive
Copy link

codenprogressive commented Aug 20, 2024

Feature Request

Enhance Markdown rendering in playground chat. For instance, if you have tables as outputs, then they will not display nicely.

For example, this is a table in Markdown format:

system Categories total_count
0 Network 67
1 Container 6
2 VMWare 2
3 Hybrid 1
4 Storage 6
5 Servers 7
6 Bare Metal 1
7 Infra (Internal use) 1

See display in Langflow playground chat:

image

@codenprogressive codenprogressive added the enhancement New feature or request label Aug 20, 2024
@ch4mploo
Copy link

Hi, I am also facing this issue and would like the playground dialogue to display a markdown table correctly. I recall that an older version of langflow is able to display a markdown table within the playground dialogue space (not sure which specific version, but it's definitely before version 1.0).

I've been trying to investigate this issue, here's my finding:

  1. The reason that the playground dialogue is unable to display a markdown table correctly is it always add an additional newline in each row of data.
  2. However, when I have inspected the text data from the memory, it did not have the additional newlines. When this text is placed in a markdown previewer, it was able to show the table correctly.

Here's a quick example using the Memory Chatbot template, with OpenAI gpt-4o-mini as the LLM.

Prompt template:

You are a friendly robot that will answer all questions given by the user.
#####
Context: {context}
#####
User: {user_message}

Markdown issue 1

In raw text:

User: Create a table of comparison between red and green apple
AI: 
Sure! Here’s a comparison table between red and green apples:

| Feature | Red Apples | Green Apples |

|-----------------------|----------------------------------|----------------------------------|

| Color | Bright red to deep crimson | Bright green |

| Taste | Sweet, sometimes slightly tart | Tart and crisp |

| Texture | Generally softer | Crunchy and firm |

| Common Varieties | Red Delicious, Fuji, Gala | Granny Smith, Pippin |

| Nutritional Value | High in antioxidants, vitamin C | High in fiber, vitamin C |

| Best Uses | Eating fresh, baking, salads | Baking, cooking, salads |

| Shelf Life | Typically shorter | Generally longer |

| Sugar Content | Higher sugar content | Lower sugar content |

Feel free to ask if you need more information!

Viewed from the memory:
Markdown issue 2

Viewed with a markdown previewer:
Markdown issue 3

in raw text (only the response):

Sure! Here’s a comparison table between red and green apples:

| Feature                | Red Apples                       | Green Apples                     |
|-----------------------|----------------------------------|----------------------------------|
| **Color**             | Bright red to deep crimson       | Bright green                     |
| **Taste**             | Sweet, sometimes slightly tart   | Tart and crisp                   |
| **Texture**           | Generally softer                 | Crunchy and firm                 |
| **Common Varieties**  | Red Delicious, Fuji, Gala        | Granny Smith, Pippin             |
| **Nutritional Value** | High in antioxidants, vitamin C  | High in fiber, vitamin C        |
| **Best Uses**         | Eating fresh, baking, salads     | Baking, cooking, salads          |
| **Shelf Life**        | Typically shorter                 | Generally longer                 |
| **Sugar Content**     | Higher sugar content              | Lower sugar content              |

Feel free to ask if you need more information!

Hope this finding will help to solve this issue. This is tested with langflow version 1.0.15.

@buntys2010
Copy link

Is this issue resolved?

Changes in pull 3687 doesn't seems to have fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants