defenseunicorns / leapfrogai

Production-ready Generative AI for local, cloud native, airgap, and edge deployments.
https://leapfrog.ai
Apache License 2.0
253 stars 29 forks source link

feat(ui) Users can select an annotation to view the passage that was used #669

Closed gregclark-defenseunicorns closed 1 month ago

gregclark-defenseunicorns commented 3 months ago

User Story

As a LFAI user
I want the reference passage in my chat thread So that I can have all the context together

Acceptance Criteria

Given I submit a prompt that references a RAG file Design: Annotation Links When I click on the the annotation link at the end of the response Then a window opens below the link displaying the passage of the reference file Design: Reference Window And I am able to scroll file within the window

When I click on an annotation link that is already Then the reference window closes

NOTE Only one reference window can be open at one time. So if one is already open and another is click then the previous one closes and the new one opens.

When I click on the annotations throughout the response ([1], [2], [3], etc) Then I am auto scrolled to the bottom of the response And the link's reference windows opens automatically (Copy behavior as though the link was clicked)

When a reference window opens for a PDF file Then I see 2 tertiary buttons (Download and Launch)

When a reference windows opens for a NON PDF file Then I see 1 tertiary button (Download)

When I click the Download button in the reference window Then the file is downloaded Design: Reference Downloaded

When I click the Launch button in the reference window Then a new tab opens displaying the PDF Design: PDF Viewer

Additional context

Design Links:

Functionality Video: https://github.com/user-attachments/assets/6b9454e6-cde3-4c6a-883e-b755e7a1f379

andrewrisse commented 2 months ago

blocked by #766