Merge pull request #415 from SaujanyaV/fix-entity-name-string

Fix: Ensure entity_or_relation_name is a string in _handle_entity_relation_summary
This commit is contained in:
zrguo
2024-12-09 17:36:06 +08:00
committed by GitHub
4 changed files with 4 additions and 4 deletions

View File

@@ -11,6 +11,7 @@ net = Network(height="100vh", notebook=True)
# Convert NetworkX graph to Pyvis network
net.from_nx(G)
# Add colors and title to nodes
for node in net.nodes:
node["color"] = "#{:06x}".format(random.randint(0, 0xFFFFFF))

View File

@@ -616,7 +616,6 @@ async def jina_embedding(
data_list = await fetch_data(url, headers, data)
return np.array([dp["embedding"] for dp in data_list])
@wrap_embedding_func_with_attrs(embedding_dim=2048, max_token_size=512)
@retry(
stop=stop_after_attempt(3),

View File

@@ -222,7 +222,7 @@ async def _merge_edges_then_upsert(
},
)
description = await _handle_entity_relation_summary(
(src_id, tgt_id), description, global_config
f"({src_id}, {tgt_id})", description, global_config
)
await knowledge_graph_inst.upsert_edge(
src_id,
@@ -572,7 +572,6 @@ async def kg_query(
mode=query_param.mode,
),
)
return response
@@ -1104,6 +1103,7 @@ async def naive_query(
response = await use_model_func(
query,
system_prompt=sys_prompt,
mode=query_param.mode,
)
if len(response) > len(sys_prompt):