ReMe/reme2/schema/base_node.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

12 lines
349 B
Python

from uuid import uuid4
from pydantic import BaseModel, Field
class BaseNode(BaseModel):
"""Base node model for graph and document structures."""
id: str = Field(default_factory=lambda: uuid4().hex)
text: str = Field(default="")
embedding: list[float] | None = Field(default=None)
metadata: dict = Field(default_factory=dict)