mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-19 00:01:33 +00:00
Some checks are pending
Pre-commit / run (ubuntu-latest) (push) Waiting to run
- 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
26 lines
737 B
Python
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."""
|