waylaidwanderer / PandoraAI

PandoraAI is a web chat client powered by node-chatgpt-api, allowing users to easily chat with multiple AI systems while also offering support for custom presets. With its seamless and convenient design, PandoraAI provides an engaging conversational AI experience.
https://github.com/waylaidwanderer/node-chatgpt-api
MIT License
841 stars 219 forks source link

Some links show up as [[number] in streaming and disappear after streaming sometimes #58

Open ztc1997 opened 1 year ago

ztc1997 commented 1 year ago

Describe the bug Some links show up as [[number] in streaming and disappear after streaming sometimes.

To Reproduce Steps to reproduce the behavior:

  1. Setup a node-chatgpt-api as a bing client
  2. Use node-chatgpt-api as PandoraAI backend

Expected behavior Links display normally

Screenshots 1680926565817.png 1680926594288.png

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

waylaidwanderer commented 1 year ago

I'm not sure but I think this is an issue on Bing's end where the AI doesn't generate the source links correctly.

cmp-nct commented 1 year ago

I think it's a problem in the UI streaming behavior. While the UI is streaming it is displaying/formating the markdown and after the message is completed the message is re-processed. If you recall my issue about having multiplication signs being "eaten", there I tried a hotfix which auto-escapes it during streaming. That works well but after the message is completed a javascript function is re-processing it and then it looked wrong. Likely related.