MCPcopy Create free account
hub / github.com/Alibaba-NLP/VRAG / add_search_node

Function add_search_node

demo/vimrag_app.py:614–633  ·  view source on GitHub ↗

添加搜索节点到图中

(node_id, parent_ids, query="")

Source from the content-addressed store, hash-verified

612
613
614def add_search_node(node_id, parent_ids, query=""):
615 """添加搜索节点到图中"""
616 # 截断过长的标签
617 label = node_id[:12] + "..." if len(node_id) > 12 else node_id
618
619 st.session_state.vis_nodes.append({
620 "id": node_id,
621 "label": f"🔍 {label}",
622 "title": f"搜索: {query}",
623 "color": {"background": "#06b6d4", "border": "#0891b2"},
624 "shape": "box",
625 "borderRadius": 8,
626 "size": 25,
627 "font": {"color": "#333", "size": 12}
628 })
629
630 for pid in parent_ids:
631 st.session_state.vis_edges.append({"from": pid, "to": node_id})
632
633 st.session_state.last_node_id = node_id
634
635
636def update_node_summary(node_id, summary):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected