mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-23 00:43:18 +00:00
- Add file_graph import to component registry - Register FILE_GRAPH enum in ComponentEnum - Implement BaseFileGraph integration in LinkedFileParser - Replace FileEdge with FileLink for better semantic clarity - Add lazy resolution of file_graph from app_context - Update file watcher logging to reflect links instead of edges refactor: streamline MCP transport layer architecture - Remove redundant step shells from reme2/mcp/steps/ - Consolidate all @R.register components to reme2.memory package - Update server.py to import reme2.memory directly - Revise README.md to document new architecture - Simplify module dependencies and import structure
20 lines
536 B
Python
20 lines
536 B
Python
from pydantic import Field
|
|
|
|
from .emb_node import EmbNode
|
|
|
|
|
|
class FileChunk(EmbNode):
|
|
path: str = Field(default="")
|
|
start_line: int = Field(default=0)
|
|
end_line: int = Field(default=0)
|
|
scores: dict[str, float] = Field(default_factory=dict)
|
|
|
|
@property
|
|
def score(self) -> float:
|
|
return self.scores.get("score", 0.0)
|
|
|
|
def set_hash_id(self):
|
|
from ..utils import hash_text
|
|
|
|
self.id = hash_text(" ".join([self.path, str(self.start_line), str(self.end_line), self.text]))
|
|
return self
|