gptscript-ai / desktop

MIT License
22 stars 13 forks source link

Knowledge - source links presented in the message response reloads the current chat thread #280

Closed sangee2004 closed 1 month ago

sangee2004 commented 2 months ago

Electron build from - b4977d084ee

Steps to reproduce the problem:

  1. Start a chat with Tildy
  2. Use Add Knowledge to add a file
  3. Ask for some information about the knowledge file.
  4. Wait for the response to be presented with source links
Screenshot 2024-08-23 at 5 23 25 PM
  1. Click the source links presented in the message response. This results in the chat view being reloaded and user is presented with the most recent chat thread view.

Expected Behavior: When source link is clicked , we should be able to open the page of knowledge document that is referenced in the source.

https://github.com/user-attachments/assets/cb64d7db-6d39-4322-8e8c-7a90725230be

cjellick commented 1 month ago

The link should definitely not cause the chat to reload, but i'm not sure exactly how we should handle this. The file is local, so im not sure how wed open it and almost certianly cannot reliable open it to the right page. Maybe we just say what doc it was instead of linking to it

cjellick commented 1 month ago

To clarify further - the knowledge tool explicitly SHOULD NOT return references to docs by default

cjellick commented 1 month ago

@StrongMonkey how feasible for is it going to be for the link to a reference of a knowledge do to actually point at the doc on disk so that it can be opened?

cjellick commented 1 month ago

@StrongMonkey im going to just asign this one to you. two parter:

  1. generally, a link should not cause the chat to reload
  2. for knowledge, either dont provide links or provide a link that opens the pdf on disk. im not sure how hard this will be
StrongMonkey commented 1 month ago

@cjellick I think it should be feasible as long as the link is the actual file path. I will give it a try

StrongMonkey commented 1 month ago

The root issue seems to be that our markdown parser didn't render the file link properly, causing an empty href. Trying to fix it now.

sangee2004 commented 1 month ago

Tested with 8809ed131d3

Source link provided now opens the file as expected.