Skip to content

Commit c4ee4b3

Browse files
Remove logging info from update KNN API
1 parent a53493c commit c4ee4b3

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

backend/score.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ async def update_similarity_graph(uri=Form(None), userName=Form(None), password=
226226
"""
227227
try:
228228
graph = create_graph_database_connection(uri, userName, password, database)
229-
result = await asyncio.to_thread(update_graph, graph)
230-
logging.info(f"result : {result}")
229+
await asyncio.to_thread(update_graph, graph)
230+
231231
josn_obj = {'api_name':'update_similarity_graph','db_url':uri}
232232
logger.log_struct(josn_obj)
233-
return create_api_response('Success',message='Updated KNN Graph',data=result)
233+
return create_api_response('Success',message='Updated KNN Graph')
234234
except Exception as e:
235235
job_status = "Failed"
236236
message="Unable to update KNN Graph"

backend/src/graphDB_dataAccess.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,13 @@ def update_KNN_graph(self):
130130
knn_min_score = os.environ.get('KNN_MIN_SCORE')
131131
if len(index) > 0:
132132
logging.info('update KNN graph')
133-
result = self.graph.query("""MATCH (c:Chunk)
133+
self.graph.query("""MATCH (c:Chunk)
134134
WHERE c.embedding IS NOT NULL AND count { (c)-[:SIMILAR]-() } < 5
135135
CALL db.index.vector.queryNodes('vector', 6, c.embedding) yield node, score
136136
WHERE node <> c and score >= $score MERGE (c)-[rel:SIMILAR]-(node) SET rel.score = score
137137
""",
138138
{"score":float(knn_min_score)}
139139
)
140-
logging.info(f"result : {result}")
141140
else:
142141
logging.info("Vector index does not exist, So KNN graph not update")
143142

backend/src/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def update_graph(graph):
370370
Update the graph node with SIMILAR relationship where embedding scrore match
371371
"""
372372
graph_DB_dataAccess = graphDBdataAccess(graph)
373-
return graph_DB_dataAccess.update_KNN_graph()
373+
graph_DB_dataAccess.update_KNN_graph()
374374

375375

376376
def connection_check(graph):

0 commit comments

Comments
 (0)