graphragzen.query.get_context.extra_inside_edges
- graphragzen.query.get_context.extra_inside_edges(graph, entities, k, only_new_edges=True)[source]
Return top edges by weight where both nodes are in the specified entities.
- Parameters:
graph (nx.Graph) – The graph containing nodes and edges.
entities (List[dict]) – List of entities who’s nodes to check for connected edges.
k (int) – Maximum number of edges to return.
only_new_edges (bool, optional) – If True, returns only edges not yet in the entities, thus output length might be less than k. Defaults to True.
- Returns:
A list of dictionaries containing ‘entity_type’, ‘entity_name’.
- Return type:
List[dict]