Skip to content

Commit cfa8195

Browse files
Merge branch 'staging' into dev
2 parents 3b24486 + 21cf0ea commit cfa8195

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/src/make_relationships.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from langchain_neo4j import Neo4jGraph
22
from langchain.docstore.document import Document
33
from src.shared.common_fn import load_embedding_model,execute_graph_query
4+
from src.shared.common_fn import load_embedding_model,execute_graph_query
45
import logging
56
from typing import List
67
import os
@@ -34,6 +35,7 @@ def merge_relationship_between_chunk_and_entites(graph: Neo4jGraph, graph_docume
3435
MERGE (c)-[:HAS_ENTITY]->(n)
3536
"""
3637
execute_graph_query(graph,unwind_query, params={"batch_data": batch_data})
38+
execute_graph_query(graph,unwind_query, params={"batch_data": batch_data})
3739

3840

3941
def create_chunk_embeddings(graph, chunkId_chunkDoc_list, file_name):
@@ -60,6 +62,7 @@ def create_chunk_embeddings(graph, chunkId_chunkDoc_list, file_name):
6062
MERGE (c)-[:PART_OF]->(d)
6163
"""
6264
execute_graph_query(graph,query_to_create_embedding, params={"fileName":file_name, "data":data_for_query})
65+
execute_graph_query(graph,query_to_create_embedding, params={"fileName":file_name, "data":data_for_query})
6366

6467
def create_relation_between_chunks(graph, file_name, chunks: List[Document])->list:
6568
logging.info("creating FIRST_CHUNK and NEXT_CHUNK relationships between chunks")
@@ -128,6 +131,7 @@ def create_relation_between_chunks(graph, file_name, chunks: List[Document])->li
128131
MERGE (c)-[:PART_OF]->(d)
129132
"""
130133
execute_graph_query(graph,query_to_create_chunk_and_PART_OF_relation, params={"batch_data": batch_data})
134+
execute_graph_query(graph,query_to_create_chunk_and_PART_OF_relation, params={"batch_data": batch_data})
131135

132136
query_to_create_FIRST_relation = """
133137
UNWIND $relationships AS relationship
@@ -137,6 +141,7 @@ def create_relation_between_chunks(graph, file_name, chunks: List[Document])->li
137141
MERGE (d)-[:FIRST_CHUNK]->(c))
138142
"""
139143
execute_graph_query(graph,query_to_create_FIRST_relation, params={"f_name": file_name, "relationships": relationships})
144+
execute_graph_query(graph,query_to_create_FIRST_relation, params={"f_name": file_name, "relationships": relationships})
140145

141146
query_to_create_NEXT_CHUNK_relation = """
142147
UNWIND $relationships AS relationship

0 commit comments

Comments
 (0)