Spaces:
Runtime error
Runtime error
Download app/models/source_file.py from simhaa-hat/ai-learning-dashboard: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/simhaa-hat/ai-learning-dashboard/resolve/main/app/models/source_file.py
- Command line
-
hf download hf://spaces/simhaa-hat/ai-learning-dashboard/app/models/source_file.py
-
curl -L -o source_file.py https://huggingface.co/spaces/simhaa-hat/ai-learning-dashboard/resolve/main/app/models/source_file.py
1.06 kB
| """Source file document — represents a single file within a project.""" | |
| from beanie import PydanticObjectId | |
| from pydantic import Field | |
| from app.models.base import BaseDocument | |
| class SourceFile(BaseDocument): | |
| """A source code file belonging to a project. | |
| Stores the file path, language, content hash (for change detection), | |
| and indexing status for RAG/KG ingestion. | |
| """ | |
| project_id: PydanticObjectId | |
| module_name: str = Field(default="", description="Logical module this file belongs to") | |
| path: str = Field(description="Relative path within the project") | |
| language: str = Field(default="python") | |
| content_hash: str = Field(default="", description="SHA-256 hash for change detection") | |
| line_count: int = 0 | |
| is_indexed: bool = Field(default=False, description="Whether RAG/KG ingestion is complete") | |
| class Settings: | |
| name = "source_files" | |
| use_state_management = True | |
| indexes = [ | |
| "project_id", | |
| [("project_id", 1), ("path", 1)], | |
| ] | |