ReMe/reme_cli/component/client/base_client.py
jinli.yl 5fc57e7f4e feat(core): refactor application architecture with new component base classes
- Add BaseClient, BaseFileStore, BaseFileWatcher, BaseJob, BaseService, and BaseStep classes
- Move component initialization logic from ApplicationContext to Application class
- Add logo printing and logging initialization in Application startup
- Create client module with base client implementation
- Add file store base class with embedding resolution and validation
- Implement file watcher base class with watchfiles integration
- Add job base class for sequential step execution orchestration
- Create service base class for job exposure mechanisms
- Refactor BaseStep with LLM workflow execution capabilities
- Add case converter utility for naming convention transformations
- Update import structure and module organization
- Add proper type hints and docstrings across all components
- Implement component registry integration for dynamic loading
- Add error handling for missing backend configurations
2026-04-14 16:43:36 +08:00

26 lines
737 B
Python

"""Abstract base class for client implementations."""
from abc import abstractmethod
from ..base_component import BaseComponent
from ...enumeration import ComponentEnum
class BaseClient(BaseComponent):
"""Abstract base class for clients that communicate with ReMe services."""
component_type = ComponentEnum.CLIENT
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self.client = None
async def _start(self, app_context=None) -> None:
"""Initialize the client."""
async def _close(self) -> None:
"""Close the client."""
@abstractmethod
async def __call__(self, action: str, **kwargs) -> dict:
"""Invoke an action with the given configuration."""