Skip to content

Commit b512e89

Browse files
2 parents f8d73f9 + a2ba507 commit b512e89

File tree

21 files changed

+224
-811
lines changed

21 files changed

+224
-811
lines changed

backend/src/make_relationships.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def create_relation_between_chunks(graph, file_name, chunks: List[Document])->li
153153
def create_chunk_vector_index(graph):
154154
start_time = time.time()
155155
try:
156-
vector_index_query = "SHOW INDEXES YIELD * WHERE labelsOrTypes = ['Chunk'] and type = 'VECTOR' AND name = 'vector' return options"
156+
vector_index_query = "SHOW INDEXES YIELD name, type, labelsOrTypes, properties WHERE name = 'vector' AND type = 'VECTOR' AND 'Chunk' IN labelsOrTypes AND 'embedding' IN properties RETURN name"
157157
vector_index = execute_graph_query(graph,vector_index_query)
158158
if not vector_index:
159159
vector_store = Neo4jVector(embedding=EMBEDDING_FUNCTION,
@@ -168,7 +168,7 @@ def create_chunk_vector_index(graph):
168168
else:
169169
logging.info(f"Index already exist,Skipping creation. Time taken: {time.time() - start_time:.2f} seconds")
170170
except Exception as e:
171-
if "EquivalentSchemaRuleAlreadyExists" in str(e):
171+
if ("EquivalentSchemaRuleAlreadyExists" in str(e) or "An equivalent index already exists" in str(e)):
172172
logging.info("Vector index already exists, skipping creation.")
173173
else:
174174
raise

frontend/index.html

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
7-
<link rel="icon" type="image/png" sizes="194x194" href="/favicons/favicon-194x194.png">
8-
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
9-
<link rel="shortcut icon" href="/favicons/favicon.ico">
10-
<title>Neo4j graph builder</title>
11-
</head>
12-
<body>
13-
<div id="root"></div>
14-
<script type="module" src="/src/main.tsx"></script>
15-
</body>
16-
</html>
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png">
8+
<link rel="icon" type="image/png" sizes="194x194" href="/favicons/favicon-194x194.png">
9+
<link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png">
10+
<link rel="shortcut icon" href="/favicons/favicon.ico">
11+
<title>Neo4j graph builder</title>
12+
</head>
13+
14+
<body>
15+
<div id="root"></div>
16+
<script type="module" src="/src/main.tsx"></script>
17+
18+
</body>
19+
20+
</html>

frontend/src/components/ChatBot/ChatInfoModal.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ const ChatInfoModal: React.FC<chatInfoMessage> = ({
8181
error?.length
8282
? 10
8383
: mode === chatModeLables['global search+vector+fulltext']
84-
? 7
85-
: mode === chatModeLables.graph
86-
? 4
87-
: 3
84+
? 7
85+
: mode === chatModeLables.graph
86+
? 4
87+
: 3
8888
);
8989
const [, copy] = useCopyToClipboard();
9090
const [copiedText, setcopiedText] = useState<boolean>(false);
@@ -97,15 +97,15 @@ const ChatInfoModal: React.FC<chatInfoMessage> = ({
9797
multiModelMetrics.length > 0 && Object.keys(multiModelMetrics[0]).length > 4
9898
? true
9999
: multiModelMetrics.length > 0 && Object.keys(multiModelMetrics[0]).length <= 4
100-
? false
101-
: null
100+
? false
101+
: null
102102
);
103103
const [isAdditionalMetricsWithSingleMode, setIsAdditionalMetricsWithSingleMode] = useState<boolean | null>(
104104
metricDetails != undefined && Object.keys(metricDetails).length > 3
105105
? true
106106
: metricDetails != undefined && Object.keys(metricDetails).length <= 3
107-
? false
108-
: null
107+
? false
108+
: null
109109
);
110110
const actions: React.ComponentProps<typeof IconButton<'button'>>[] = useMemo(
111111
() => [
@@ -320,6 +320,7 @@ const ChatInfoModal: React.FC<chatInfoMessage> = ({
320320
src={Neo4jRetrievalLogo}
321321
style={{ width: isTablet ? 80 : 95, height: isTablet ? 80 : 95, marginRight: 10 }}
322322
loading='lazy'
323+
alt='Retrieval-logo'
323324
/>
324325
<div className='flex! flex-col'>
325326
<Typography variant='h2'>Retrieval information</Typography>

frontend/src/components/ChatBot/ChunkInfo.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const ChunkInfo: FC<ChunkProps> = ({ loading, chunks, mode }) => {
8383
) : chunk?.url && chunk?.start_time ? (
8484
<>
8585
<div className='flex! flex-row justiy-between items-center gap-1'>
86-
<img src={youtubelogo} width={20} height={20} className='mr-2' />
86+
<img src={youtubelogo} width={20} height={20} className='mr-2' alt='youtube-source-logo' />
8787
<TextLink
8888
href={generateYouTubeLink(chunk?.url, chunk?.start_time)}
8989
type={'external'}
@@ -119,7 +119,7 @@ const ChunkInfo: FC<ChunkProps> = ({ loading, chunks, mode }) => {
119119
) : chunk?.url && new URL(chunk.url).host === 'wikipedia.org' ? (
120120
<>
121121
<div className='flex! flex-row justiy-between items-center gap-1'>
122-
<img src={wikipedialogo} width={20} height={20} className='mr-2' />
122+
<img src={wikipedialogo} width={20} height={20} className='mr-2' alt='wikipedia-source-logo' />
123123
<Typography variant='subheading-medium'>{chunk?.fileName}</Typography>
124124
</div>
125125
{mode !== chatModeLables['global search+vector+fulltext'] &&
@@ -146,7 +146,7 @@ const ChunkInfo: FC<ChunkProps> = ({ loading, chunks, mode }) => {
146146
) : chunk?.url && new URL(chunk.url).host === 'storage.googleapis.com' ? (
147147
<>
148148
<div className='flex! flex-row justiy-between items-center gap-1'>
149-
<img src={gcslogo} width={20} height={20} className='mr-2' />
149+
<img src={gcslogo} width={20} height={20} className='mr-2' alt='gcs-source-logo' />
150150
<Typography variant='subheading-medium'>{chunk?.fileName}</Typography>
151151
</div>
152152
{mode !== chatModeLables['global search+vector+fulltext'] &&
@@ -171,7 +171,7 @@ const ChunkInfo: FC<ChunkProps> = ({ loading, chunks, mode }) => {
171171
) : chunk?.url && chunk?.url.startsWith('s3://') ? (
172172
<>
173173
<div className='flex! flex-row justiy-between items-center gap-1'>
174-
<img src={s3logo} width={20} height={20} className='mr-2' />
174+
<img src={s3logo} width={20} height={20} className='mr-2' alt='s3-source-logo' />
175175
<Typography variant='subheading-medium'>{chunk?.fileName}</Typography>
176176
</div>
177177
{mode !== chatModeLables['global search+vector+fulltext'] &&

frontend/src/components/ChatBot/SourcesInfo.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ const SourcesInfo: FC<SourcesProps> = ({ loading, mode, chunks, sources }) => {
4242
{s.fileSource === 'local file' ? (
4343
<DocumentTextIconOutline className='n-size-token-7 mr-2' />
4444
) : (
45-
<img src={getLogo(themeUtils.colorMode)[s.fileSource]} width={20} height={20} className='mr-2' />
45+
<img
46+
src={getLogo(themeUtils.colorMode)[s.fileSource]}
47+
width={20}
48+
height={20}
49+
className='mr-2'
50+
alt='source-logo'
51+
/>
4652
)}
4753
<Typography
4854
variant='body-medium'
@@ -91,7 +97,7 @@ const SourcesInfo: FC<SourcesProps> = ({ loading, mode, chunks, sources }) => {
9197
{youtubeLinkValidation(link) && (
9298
<>
9399
<div className='flex! flex-row justiy-between items-center'>
94-
<img src={youtubelogo} width={20} height={20} className='mr-2' />
100+
<img src={youtubelogo} width={20} height={20} className='mr-2' alt='youtube-source-logo' />
95101
<TextLink href={link} type='external' target='_blank'>
96102
<HoverableLink url={link}>
97103
<Typography

frontend/src/components/DataSources/Web/WebButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const WebButton: React.FC<DataComponentProps> = ({ openModal, isLargeDesktop = t
1515
wrapperclassName='my-2'
1616
className={isLargeDesktop ? 'webImg' : 'widthunset'}
1717
isDisabled={isDisabled}
18+
title='Web Sources'
1819
/>
1920
);
2021
};

frontend/src/components/Layout/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const Header: React.FC<HeaderProp> = ({ chatOnly, deleteOnClick, setOpenConnecti
8787
aria-label='main navigation'
8888
>
8989
<section className='flex w-1/3 shrink-0 grow-0 items-center min-w-[200px]'>
90-
<Typography variant='h6' as='a' href='#app-bar-with-responsive-menu'>
90+
<Typography variant='h1'>
9191
<img
9292
src={colorMode === 'dark' ? Neo4jLogoBW : Neo4jLogoColor}
9393
className='h-8! min-h-8 min-w-8'

0 commit comments

Comments
 (0)