ReMe/reme2/schema/request.py
jinli.yl baf110e602
Some checks are pending
Pre-commit / run (ubuntu-latest) (push) Waiting to run
feat(components): add token counter and file-based utility components
- Introduce BaseAsTokenCounter and EstimatedAsTokenCounter for token estimation
- Add AsMsgStat and AsBlockStat schema for message statistics tracking
- Implement FileIO class with read/write/append/edit operations
- Create file utility functions for safe async file reading and truncation
- Add MemorySearch component for semantic search in memory files
- Register new component types in ComponentEnum and update imports
- Add constants for default host, port, and truncation limits
- Create BaseService abstract base class for service implementations
- Implement BaseStep with component accessors and lifecycle management
- Add proper __all__ exports for all new modules and components
2026-04-16 20:21:04 +08:00

25 lines
722 B
Python

"""Request schema module.
This module defines the Request model for handling incoming requests
in the application service layer.
"""
from pydantic import BaseModel, ConfigDict, Field
class Request(BaseModel):
"""Request model for service endpoints.
Represents an incoming request with optional metadata and
extensible fields for various request types.
The model uses ConfigDict with extra="allow" to support
dynamically added fields while maintaining type safety.
Attributes:
metadata: Request-level metadata for tracking and context.
"""
model_config = ConfigDict(extra="allow")
metadata: dict = Field(default_factory=dict, description="Request metadata for context")