This commit is contained in:
jinli.yl 2026-05-15 11:01:42 +08:00
parent 92defa0949
commit 02a77305ed
5 changed files with 62 additions and 41 deletions

View file

@ -1,50 +1,60 @@
# all @jinli
# 通用
reme help
reme start
reme restart
reme version
reme vault="My Vault"
# daily
daily:path
reme daily:xxx
| 能力 | 参数 |
|---------|----|
| help | |
| start | |
| restart | |
| version | |
| tags | |
# crud
reme create file="New Note" content="# Hello" title="xxx" tags="[]" status=""
reme read file=Recipe/path="Templates/Recipe.md"
reme edit file=Recipe/path="Templates/Recipe.md" old="xxx" new="xxx"
reme append file="My Note" content="New line"
reme prepend file="My Note" content="New line"
reme delete file="My Note"/path
| 能力 | 参数 |
|---------|-------------------------------------------------------------------|
| create | path="New Note" content="# Hello" title="xxx" tags="[]" status="" |
| read | path="Templates/Recipe.md" |
| edit | path="Templates/Recipe.md" old="xxx" new="xxx" |
| append | path="My Note" content="New line" |
| prepend | path="My Note" content="New line" |
| delete | path="My Note" |
# reme
# daily:crud
reme stat file/path
reme list file/path
| 能力 | 参数 |
|-----------|---------------|
| daily:xxx | 与 crud 参数保持一致 |
# stat / list
| 能力 | 参数 |
|------|------|
| stat | path |
| list | path |
# search
reme search query="search term" limit=10 tag="[]" score=0.1 copy=true
| 能力 | 参数 |
|--------|-----------------------------------------------------------|
| search | query="search term" limit=10 tag="[]" score=0.1 copy=true |
# property
reme property:read
reme property:update file="My Note" status=done xx=xxx
reme property:delete keys="[xxxx, xxxx]"
| 能力 | 参数 |
|-----------------|-----------------------------------|
| property:read | |
| property:update | path="My Note" status=done xx=xxx |
| property:delete | keys="[xxxx, xxxx]" |
# 全局所有标签
# link
reme tags
| 能力 | 参数 |
|-----------|----------------|
| backlinks | path="My Note" |
| links | path="My Note" |
# show link
reme backlinks file="My Note"
reme links file="My Note"
[[Algorithm Notes#Sorting]]
记忆的类型

0
reme2/steps/__init__.py Normal file
View file

View file

@ -1,26 +1,25 @@
"""Base step class for LLM workflow execution."""
import copy
from abc import abstractmethod
from abc import abstractmethod, ABC
from agentscope.formatter import FormatterBase
from agentscope.model import ChatModelBase
from agentscope.token import TokenCounterBase
from .base_component import BaseComponent
from .embedding import BaseEmbeddingModel
from .file_parser import BaseFileParser
from .file_store import BaseFileStore
from .prompt_handler import PromptHandler
from .runtime_context import RuntimeContext
from ..component import ApplicationContext
from ..component.embedding import BaseEmbeddingModel
from ..component.file_parser import BaseFileParser
from ..component.file_store import BaseFileStore
from ..component.prompt_handler import PromptHandler
from ..component.runtime_context import RuntimeContext
from ..enumeration import ComponentEnum
from ..utils import get_logger
class BaseStep(BaseComponent):
class BaseStep(ABC):
"""Base step for LLM workflow execution and composition."""
component_type = ComponentEnum.STEP
def __new__(cls, *args, **kwargs):
instance = super().__new__(cls)
instance._init_args = copy.copy(args)
@ -29,19 +28,31 @@ class BaseStep(BaseComponent):
def __init__(
self,
name: str | None = None,
backend: str = "",
app_context: "ApplicationContext | None" = None,
language: str = "",
prompt_dict: dict[str, str] | None = None,
input_mapping: dict[str, str] | None = None,
output_mapping: dict[str, str] | None = None,
**kwargs,
):
super().__init__(**kwargs)
super().__init__()
self.name: str = name or self.__class__.__name__
self.backend: str = backend
self.app_context: "ApplicationContext | None" = app_context
self.kwargs: dict = dict(kwargs)
self.logger = get_logger()
if hasattr(self.logger, "bind"):
self.logger = self.logger.bind(component=self.name)
self.language = language
self.prompt = PromptHandler(language=self.language)
self.prompt.load_prompt_by_class(self.__class__).load_prompt_dict(prompt_dict)
self.input_mapping = input_mapping
self.output_mapping = output_mapping
self.context: RuntimeContext | None = None
self.kwargs: dict = kwargs
@abstractmethod
async def execute(self):

View file

View file