mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-17 23:51:19 +00:00
- Integrate AnthropicChatModel with new AnthropicAsLLM component - Add component formatters for OpenAI and Anthropic chat models - Implement token counter component with estimated token counting - Create base client component for ReMe service communication - Refactor BaseComponent to remove app_context parameter from _start/_close - Update embedding model base class to remove retry logic and use npz cache - Add job component for sequential step execution with BaseJob - Implement step component base class for LLM workflow execution - Enhance application context with proper type annotations - Update component initialization to pass app_context automatically - Remove asyncio dependency from embedding model cache operations
25 lines
682 B
Python
25 lines
682 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) -> None:
|
|
|
|
async def _close(self) -> None:
|
|
"""Close the client."""
|
|
|
|
@abstractmethod
|
|
async def __call__(self, action: str, **kwargs) -> dict:
|
|
"""Invoke an action with the given configuration."""
|