-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* progress restructuring * useMainChatAPI * rearranged runQuery to show results faster * edited styling * copyright, added LLM warning to query history names * added linkq status type, refactored LinkQChatMessageType * linkq status checkpoint * fixed type issues, added status badge * can edit API key through UI * separated settings component --------- Co-authored-by: Harry Li <[email protected]>
- Loading branch information
1 parent
23de07d
commit 8e1edf0
Showing
28 changed files
with
682 additions
and
355 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,9 +20,5 @@ | |
#results-content { | ||
color: white; | ||
padding: 1em; | ||
|
||
#empty-results-message { | ||
text-align: center; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,99 +1,47 @@ | ||
// Copyright (c) 2024 Massachusetts Institute of Technology | ||
// SPDX-License-Identifier: MIT | ||
import { Title } from '@mantine/core'; | ||
|
||
import { ApiKeyWarning } from 'components/ApiKeyWarning'; | ||
import { Chat } from 'components/Chat/Chat'; | ||
import { DemoModeModal } from 'components/DemoModeModal'; | ||
import { ErrorMessage } from 'components/ErrorMessage'; | ||
import { IDTableContainer } from 'components/IDTable/IDTable'; | ||
import { InfoModal } from 'components/InfoModal'; | ||
import { LLMWarning } from 'components/LLMWarning'; | ||
import { QueryEditor } from 'components/QueryEditor/QueryEditor' | ||
import { QueryVisualization } from "components/QueryVisualization/QueryVisualization"; | ||
import { ResultsTable } from 'components/ResultsTable/ResultsTable'; | ||
import { Results } from 'components/Results/Results'; | ||
|
||
import { useAppSelector } from 'redux/store'; | ||
|
||
import { useRunQuery, RunQueryProvider } from 'hooks/useRunQuery'; | ||
import { MainChatAPIProvider } from 'hooks/useMainChatAPI'; | ||
import { RunQueryProvider } from 'hooks/useRunQuery'; | ||
|
||
import styles from 'App.module.scss' | ||
|
||
|
||
function App() { | ||
return ( | ||
<RunQueryProvider> | ||
<div id={styles["app"]}> | ||
<div id={styles["sidebar"]}> | ||
<Chat/> | ||
</div> | ||
|
||
<div id={styles["content"]}> | ||
<QueryEditor/> | ||
<MainChatAPIProvider> | ||
<RunQueryProvider> | ||
<div id={styles["app"]}> | ||
<div id={styles["sidebar"]}> | ||
<Chat/> | ||
</div> | ||
|
||
<div id={styles["content"]}> | ||
<QueryEditor/> | ||
|
||
<IDTableContainer/> | ||
<IDTableContainer/> | ||
|
||
<QueryVisualization/> | ||
<QueryVisualization/> | ||
|
||
<div id={styles["results-content"]}> | ||
<Results/> | ||
<div id={styles["results-content"]}> | ||
<Results/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<DemoModeModal/> | ||
<ApiKeyWarning/> | ||
</RunQueryProvider> | ||
<DemoModeModal/> | ||
<ApiKeyWarning/> | ||
</RunQueryProvider> | ||
</MainChatAPIProvider> | ||
) | ||
} | ||
|
||
export default App | ||
|
||
|
||
function Results() { | ||
const { runQueryIsPending } = useRunQuery() | ||
const results = useAppSelector(state => state.results.results) | ||
|
||
if(runQueryIsPending) { | ||
return <p>Loading...</p> | ||
} | ||
else if(results?.error) { | ||
return ( | ||
<> | ||
<p>There was an error running your query</p> | ||
<pre>{results.error}</pre> | ||
</> | ||
) | ||
} | ||
else if(results?.data) { | ||
return ( | ||
<> | ||
<Title order={4}>Results Summary from LLM</Title> | ||
{results.summary ? ( | ||
<div> | ||
<LLMWarning> | ||
<p>This results summary was generated by an LLM that can make mistakes. Refer below to the Results Table from KG for ground-truth data.</p> | ||
<p>Note that the absence of data does not necessairly mean that there is no data. It is possible that the query did not find what that you are looking for.</p> | ||
</LLMWarning> | ||
|
||
<p>{results.summary}</p> | ||
</div> | ||
) : <ErrorMessage>There was an error generating a summary.</ErrorMessage>} | ||
|
||
<hr/> | ||
|
||
<Title order={4}> | ||
Results Table from KG | ||
<InfoModal title="Results Table from KG"> | ||
<p>These are ground-truth results retrieved from the KG using the query you executed.</p> | ||
<p>Note that the absence of data does not necessairly mean that there is no data. It is possible that the query did not find what that you are looking for.</p> | ||
</InfoModal> | ||
</Title> | ||
<ResultsTable data={results.data}/> | ||
</> | ||
) | ||
} | ||
else { | ||
return <p id={styles["empty-results-message"]}><b>Run a query to see results!</b></p> | ||
} | ||
} |
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,6 @@ | ||
/* Copyright (c) 2024 Massachusetts Institute of Technology */ | ||
/* SPDX-License-Identifier: MIT */ | ||
|
||
#empty-results-message { | ||
text-align: center; | ||
} |
Oops, something went wrong.