ReMe/reme2/schema/file_chunk.py
jinli.yl ca5970c6b0 refactor(component): refactor base components and file store implementations
- Remove abstract methods from base component start/close
- Update BaseJob to remove name parameter and simplify initialization
- Change file modification time field from mtime_ms to modified_time in seconds
- Add type checking imports and improve typing annotations
- Implement LocalFileStore with JSONL persistence for file chunks
- Add MdFileParser with markdown and frontmatter support
- Simplify HttpClient call method with proper kwargs handling
- Remove unused ReMe class methods and create backup version
- Update StreamJob to use step_components instead of steps attribute
2026-04-23 17:44:25 +08:00

21 lines
536 B
Python

from pydantic import Field
from .base_node import BaseNode
class FileChunk(BaseNode):
"""File content chunk with positional and scoring metadata."""
path: str = Field(...)
start_line: int = Field(...)
end_line: int = Field(...)
hash: str = Field(...)
scores: dict[str, float] = Field(default_factory=dict)
@property
def score(self) -> float:
return self.scores.get("score", 0.0)
@property
def unique_key(self) -> str:
return f"{self.path}:{self.start_line}:{self.end_line}"