Skip to content

Post-Processing-Alerts #758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions frontend/src/components/ChatBot/Chatbot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { buttonCaptions, chatModeLables, tooltips } from '../../utils/Constants'
import useSpeechSynthesis from '../../hooks/useSpeech';
import ButtonWithToolTip from '../UI/ButtonWithToolTip';
import FallBackDialog from '../UI/FallBackDialog';
import { capitalizeWithPlus } from '../../utils/Utils';
import { capitalize } from '@mui/material';
const InfoModal = lazy(() => import('./ChatInfoModal'));

const Chatbot: FC<ChatbotProps> = (props) => {
Expand All @@ -44,7 +46,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
const [tokensUsed, setTokensUsed] = useState<number>(0);
const [cypherQuery, setcypherQuery] = useState<string>('');
const [copyMessageId, setCopyMessageId] = useState<number | null>(null);
const [chatsMode, setChatsMode] = useState<string>(chatModeLables.graph_vector);
const [chatsMode, setChatsMode] = useState<string>(chatModeLables.graph_vector_fulltext);
const [graphEntitites, setgraphEntitites] = useState<[]>([]);
const [messageError, setmessageError] = useState<string>('');

Expand Down Expand Up @@ -179,7 +181,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
let error;
let entitiysearchonly_entities;
const datetime = `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
const userMessage = { id: Date.now(), user: 'user', message: inputMessage, datetime: datetime };
const userMessage = { id: Date.now(), user: 'user', message: inputMessage, datetime: datetime, mode: chatMode };
setListMessages([...listMessages, userMessage]);
try {
setInputMessage('');
Expand Down Expand Up @@ -325,6 +327,15 @@ const Chatbot: FC<ChatbotProps> = (props) => {
className={`p-4 self-start ${isFullScreen ? 'max-w-[55%]' : ''} ${
chat.user === 'chatbot' ? 'n-bg-palette-neutral-bg-strong' : 'n-bg-palette-primary-bg-weak'
} `}
subheader={
chat.user !== 'chatbot' && chat.mode?.length ? (
<Typography variant='subheading-small'>
Chat Mode: {chat.mode.includes('+') ? capitalizeWithPlus(chat.mode) : capitalize(chat.mode)}
</Typography>
) : (
''
)
}
>
<div
className={`${
Expand Down Expand Up @@ -430,7 +441,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
<ButtonWithToolTip
label='Q&A Button'
placement='top'
text={`Query Documents in ${chatMode} mode`}
text={`Ask a question.`}
type='submit'
disabled={loading || !connectionStatus}
size='medium'
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ const Content: React.FC<ContentProps> = ({
}
if (processedCount === 1 && queue.isEmpty()) {
(async () => {
showNormalToast('Some Q&A functionality will only be available afterwards.');
await postProcessing(userCredentials as UserCredentials, postProcessingTasks);
showSuccessToast('All Q&A functionality is available now.');
})();
}
}, [processedCount, userCredentials, queue]);
Expand Down Expand Up @@ -374,7 +376,9 @@ const Content: React.FC<ContentProps> = ({

const addFilesToQueue = async (remainingFiles: CustomFile[]) => {
if (!remainingFiles.length) {
showNormalToast('Some Q&A functionality will only be available afterwards.');
await postProcessing(userCredentials as UserCredentials, postProcessingTasks);
showSuccessToast('All Q&A functionality is available now.');
}
for (let index = 0; index < remainingFiles.length; index++) {
const f = remainingFiles[index];
Expand Down Expand Up @@ -787,7 +791,7 @@ const Content: React.FC<ContentProps> = ({
<div>
<ButtonWithToolTip
placement='top'
text='Configure Graph Schema, Delete disconnected Entities, Merge duplicate Entities'
text='Enhance graph quality'
label='Graph Enhancemnet Settings'
className='mr-2.5'
onClick={toggleEnhancementDialog}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Popups/Settings/SchemaFromText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const SchemaFromTextDialog = ({
<ButtonWithToolTip
placement='top'
label='Analyze button'
text={userText.trim() === '' ? 'please fill the text to extract graph schema' : buttonCaptions.analyze}
text={userText.trim() === '' ? 'please fill the text to extract graph schema' : 'Analyze text for schema'}
loading={loading}
disabled={userText.trim() === '' || loading}
onClick={clickHandler}
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/utils/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,25 +163,25 @@ export const queryMap: {
};

export const tooltips = {
generateGraph: 'Select one or more (new) files to turn into a graph.',
generateGraph: 'Generate graph from selected files',
deleteFile: 'Select one or more files to delete.',
showGraph: 'Select one or more files to preview the generated graph.',
bloomGraph: 'Open Neo4j Bloom for advanced graph interaction and exploration.',
showGraph: 'Preview generated graph.',
bloomGraph: 'Visualize the graph in Bloom',
deleteSelectedFiles: 'File/Files to be deleted',
documentation: 'Documentation',
github: 'GitHub Issues',
theme: 'Light / Dark mode',
settings: 'Entity Graph Extraction Settings',
chat: 'Ask questions about the processed documents.',
sources: 'Upload files of different formats.',
chat: 'Start a chat',
sources: 'Upload files',
deleteChat: 'Delete',
maximise: 'Maximise',
copy: 'Copy to Clipboard',
copied: 'Copied',
stopSpeaking: 'Stop Speaking',
textTospeech: 'Text to Speech',
createSchema: 'Create your own schema by passing text',
useExistingSchema: 'Use the already existing schema from DB',
createSchema: 'Define schema from text.',
useExistingSchema: 'Fetch schema from database',
clearChat: 'Clear Chat History',
continue: 'Continue',
clearGraphSettings: 'Clear configured Graph Schema',
Expand Down