Extract relationship information from index data
(index_data: Dict)
| 109 | |
| 110 | |
| 111 | def extract_relationships(index_data: Dict) -> List[RelationshipInfo]: |
| 112 | """Extract relationship information from index data""" |
| 113 | relationships = [] |
| 114 | |
| 115 | relationship_list = index_data.get("relationships", []) |
| 116 | |
| 117 | for rel in relationship_list: |
| 118 | relationship = RelationshipInfo( |
| 119 | repo_file_path=rel.get("repo_file_path", ""), |
| 120 | target_file_path=rel.get("target_file_path", ""), |
| 121 | relationship_type=rel.get("relationship_type", ""), |
| 122 | confidence_score=rel.get("confidence_score", 0.0), |
| 123 | helpful_aspects=rel.get("helpful_aspects", []), |
| 124 | potential_contributions=rel.get("potential_contributions", []), |
| 125 | usage_suggestions=rel.get("usage_suggestions", ""), |
| 126 | ) |
| 127 | relationships.append(relationship) |
| 128 | |
| 129 | return relationships |
| 130 | |
| 131 | |
| 132 | def calculate_relevance_score( |
no test coverage detected