-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chat): chat on project documents (#18)
* feat(chat): chat on top of all documents * feat(chat): remove extra print statements * feat[Chat]: chat with references for the answers * feat[chat]: display multiple references of chat * feat(chat): push chat reference data * fix(chat): clean reference ui
- Loading branch information
1 parent
9591060
commit 2574a4f
Showing
9 changed files
with
386 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
"use client"; | ||
import React from "react"; | ||
import Drawer from "./ui/Drawer"; | ||
import HighlightPdfViewer from "../ee/components/HighlightPdfViewer"; | ||
import { FlattenedSource, Source } from "@/interfaces/processSteps"; | ||
import { BASE_STORAGE_URL } from "@/constants"; | ||
|
||
interface IProps { | ||
filename: string; | ||
project_id: number; | ||
sources: FlattenedSource[]; | ||
isOpen?: boolean; | ||
onCancel: () => void; | ||
} | ||
|
||
const ChatReferenceDrawer = ({ | ||
isOpen = true, | ||
project_id, | ||
sources, | ||
filename, | ||
onCancel, | ||
}: IProps) => { | ||
let file_url = null; | ||
if (project_id) { | ||
file_url = `${BASE_STORAGE_URL}/${project_id}/${filename}`; | ||
} | ||
|
||
return ( | ||
<Drawer isOpen={isOpen} onClose={onCancel} title="Chat Reference"> | ||
{file_url && ( | ||
<HighlightPdfViewer file={file_url} highlightSources={sources} /> | ||
)} | ||
</Drawer> | ||
); | ||
}; | ||
|
||
export default ChatReferenceDrawer; |
Oops, something went wrong.