Skip to content

Commit

Permalink
Merge branch 'STAGING' into DEV
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikpersistent authored Dec 10, 2024
2 parents b671189 + 919d19e commit c431903
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion frontend/example.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VITE_BACKEND_API_URL="http://localhost:8000"
VITE_BLOOM_URL="https://workspace-preview.neo4j.io/workspace/explore?connectURL={CONNECT_URL}&search=Show+me+a+graph&featureGenAISuggestions=true&featureGenAISuggestionsInternal=true"
VITE_REACT_APP_SOURCES="local,youtube,wiki,s3,web"
VITE_LLM_MODELS="diffbot,openai-gpt-3.5,openai-gpt-4o"
VITE_LLM_MODELS="diffbot,openai_gpt_3.5,openai_gpt_4o"
VITE_ENV="DEV"
VITE_TIME_PER_PAGE=50
VITE_CHUNK_SIZE=5242880
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/components/ChatBot/Chatbot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
} else {
setListMessages((prev) =>
prev.map((msg) =>
(msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg)
msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg
)
);
}
Expand All @@ -264,7 +264,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
} else {
setListMessages((prev) =>
prev.map((msg) =>
(msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg)
msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg
)
);
}
Expand All @@ -273,15 +273,15 @@ const Chatbot: FC<ChatbotProps> = (props) => {
console.error(`API call failed for mode ${mode}:`, result.reason);
setListMessages((prev) =>
prev.map((msg) =>
(msg.id === chatbotMessageId
msg.id === chatbotMessageId
? {
...msg,
modes: {
...msg.modes,
[mode]: { message: 'Failed to fetch response for this mode.', error: result.reason },
},
}
: msg)
: msg
)
);
}
Expand All @@ -294,7 +294,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
if (error instanceof Error) {
setListMessages((prev) =>
prev.map((msg) =>
(msg.id === chatbotMessageId
msg.id === chatbotMessageId
? {
...msg,
isLoading: false,
Expand All @@ -306,7 +306,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
},
},
}
: msg)
: msg
)
);
}
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/ChatBot/MultiModeMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export default function MultiModeMetrics({
],
[]
);

const columnswithoutSemanticAndRougeScores = useMemo(
() => [
columnHelper.accessor((row) => row.mode, {
Expand Down Expand Up @@ -316,6 +317,7 @@ export default function MultiModeMetrics({
);
const table = useReactTable(config);


return (
<Box>
{error?.trim() != '' ? (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Layout/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const PageLayout: React.FC = () => {
showDisconnectButton,
} = useCredentials();
const { cancel } = useSpeechSynthesis();

useEffect(() => {
async function initializeConnection() {
const session = localStorage.getItem('neo4j.connection');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ export default function DeduplicationTab() {
const onRemove = (nodeid: string, similarNodeId: string) => {
setDuplicateNodes((prev) => {
return prev.map((d) =>
(d.e.elementId === nodeid
d.e.elementId === nodeid
? {
...d,
similar: d.similar.filter((n) => n.elementId != similarNodeId),
}
: d)
: d
);
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export default function SelectedJobList({
}) {
const ongoingPostProcessingTasks = useMemo(
() =>
(isGdsActive
isGdsActive
? postProcessingTasks.includes('enable_communities')
? postProcessingTasks
: postProcessingTasks.filter((s) => s != 'enable_communities')
: postProcessingTasks.filter((s) => s != 'enable_communities')),
: postProcessingTasks.filter((s) => s != 'enable_communities'),
[isGdsActive, postProcessingTasks]
);
return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export const isFileCompleted = (waitingFile: CustomFile, item: SourceNode) =>
waitingFile && item.status === 'Completed';

export const calculateProcessedCount = (prev: number, batchSize: number) =>
(prev === batchSize ? batchSize - 1 : prev + 1);
prev === batchSize ? batchSize - 1 : prev + 1;

export const isProcessingFileValid = (item: SourceNode, userCredentials: UserCredentials) => {
return item.status === 'Processing' && item.fileName != undefined && userCredentials && userCredentials.database;
Expand Down

0 comments on commit c431903

Please sign in to comment.