ReMe/reme_cli/schema/file_metadata.py
jinli.yl 4b5fb37b6a
Some checks are pending
Pre-commit / run (ubuntu-latest) (push) Waiting to run
feat(core): add core components and architecture for ReMe CLI
- Implement BaseComponent with async lifecycle and context management
- Add ApplicationContext for managing component initialization and registry
- Create Application class for orchestrating job execution and lifecycle
- Add AS LLM components with OpenAI chat model wrapper
- Implement AS LLM formatter components with OpenAI formatter
- Add client implementations including base, HTTP and ReMe clients
- Create embedding model base class with caching and batching support
- Implement file store base class with vector and full-text search
- Add file watcher components for monitoring file system changes
- Create job components for executing workflows
- Implement service components for exposing jobs via different protocols
- Add configuration schema with ApplicationConfig and ComponentConfig
- Include utility modules for case conversion, chunking, logging and similarity
- Register component types and create component registry system
2026-04-13 23:51:59 +08:00

33 lines
1.5 KiB
Python

"""File metadata schema module.
This module defines the FileMetadata model for tracking file state and
content information in the document processing pipeline.
"""
from pydantic import BaseModel, Field
class FileMetadata(BaseModel):
"""File metadata with optional extended fields.
Stores essential file information for tracking changes and
managing the document processing pipeline. Optional fields allow
for different usage patterns (e.g., just tracking vs. full content).
Attributes:
hash: Hash of the file content for change detection.
mtime_ms: Last modification time in milliseconds since epoch.
size: File size in bytes.
path: Relative path to the file within the workspace.
content: Parsed content from the file (optional, memory-intensive).
chunk_count: Number of chunks extracted from this file.
metadata: Additional file-specific metadata.
"""
hash: str = Field(..., description="Hash of file content for change detection")
mtime_ms: float = Field(..., description="Last modification time in milliseconds")
size: int = Field(..., description="File size in bytes")
path: str | None = Field(default=None, description="Relative path within workspace")
content: str | None = Field(default=None, description="Parsed content (optional)")
chunk_count: int | None = Field(default=None, description="Number of extracted chunks")
metadata: dict = Field(default_factory=dict, description="Additional file metadata")