Download coderag/records.py from akdybala/coderag-retrieval-console: direct link, hf CLI and curl.
- Browser
- Download file 1.71 kB
-
https://huggingface.co/spaces/akdybala/coderag-retrieval-console/resolve/main/coderag/records.py
- Command line
-
hf download hf://spaces/akdybala/coderag-retrieval-console/coderag/records.py
-
curl -L -o records.py https://huggingface.co/spaces/akdybala/coderag-retrieval-console/resolve/main/coderag/records.py
1.71 kB
| """Serializable records produced by the CodeRAG indexers.""" | |
| from dataclasses import asdict, dataclass, field | |
| class FunctionRecord: | |
| function_id: str | |
| name: str | |
| qualified_name: str | |
| symbol_type: str | |
| file_path: str | |
| start_line: int | |
| end_line: int | |
| signature: str | |
| docstring: str | None | |
| raw_code: str | |
| own_sketch: str | |
| own_summary: str | |
| direct_callees: list[str] = field(default_factory=list) | |
| unresolved_calls: list[str] = field(default_factory=list) | |
| callee_context: str = "" | |
| propagated_text: str = "" | |
| code_domain_scores: dict[str, float] = field(default_factory=dict) | |
| top_code_domains: list[str] = field(default_factory=list) | |
| structural_signals: dict = field(default_factory=dict) | |
| data_flow_signals: dict = field(default_factory=dict) | |
| semantic_signals: dict = field(default_factory=dict) | |
| def to_dict(self) -> dict: | |
| return asdict(self) | |
| class FileIndex: | |
| schema_version: str | |
| file_path: str | |
| function_count: int | |
| call_edges: list[dict[str, str]] | |
| indexing_order: list[str] | |
| functions: list[FunctionRecord] | |
| def to_dict(self) -> dict: | |
| result = asdict(self) | |
| result["functions"] = [record.to_dict() for record in self.functions] | |
| return result | |
| class RepositoryIndex: | |
| schema_version: str | |
| root_path: str | |
| file_count: int | |
| function_count: int | |
| call_edges: list[dict[str, str]] | |
| indexing_order: list[str] | |
| functions: list[FunctionRecord] | |
| files: list[str] | |
| def to_dict(self) -> dict: | |
| result = asdict(self) | |
| result["functions"] = [record.to_dict() for record in self.functions] | |
| return result | |