MCPcopy Create free account
hub / github.com/Enfoirer/Text2GraphRAG / _process

Function _process

nano_graphrag/_op.py:990–1010  ·  view source on GitHub ↗
(community_truncated_datas: list[CommunitySchema])

Source from the content-addressed store, hash-verified

988 communities_data = communities_data[len(this_group) :]
989
990 async def _process(community_truncated_datas: list[CommunitySchema]) -> dict:
991 communities_section_list = [["id", "content", "rating", "importance"]]
992 for i, c in enumerate(community_truncated_datas):
993 communities_section_list.append(
994 [
995 i,
996 c["report_string"],
997 c["report_json"].get("rating", 0),
998 c["occurrence"],
999 ]
1000 )
1001 community_context = list_of_list_to_csv(communities_section_list)
1002 sys_prompt_temp = PROMPTS["global_map_rag_points"]
1003 sys_prompt = sys_prompt_temp.format(context_data=community_context)
1004 response = await use_model_func(
1005 query,
1006 system_prompt=sys_prompt,
1007 **query_param.global_special_community_map_llm_kwargs,
1008 )
1009 data = use_string_json_convert_func(response)
1010 return data.get("points", [])
1011
1012 logger.info(f"Grouping to {len(community_groups)} groups for global search")
1013 responses = await asyncio.gather(*[_process(c) for c in community_groups])

Callers 1

_map_global_communitiesFunction · 0.85

Calls 1

list_of_list_to_csvFunction · 0.85

Tested by

no test coverage detected