mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-07 08:26:06 +00:00
[dev] add worker_name to workflow
This commit is contained in:
parent
3e24a00e8d
commit
1b088fcca2
4 changed files with 55 additions and 21 deletions
|
|
@ -15,52 +15,50 @@ memory_service:
|
|||
contextual_msg_count: 6
|
||||
read_memory_key: read_memory
|
||||
memory_operations:
|
||||
contextual_message:
|
||||
read_message:
|
||||
class: memory.operation.read_memory
|
||||
workflow: dummy
|
||||
workflow: dummy_worker
|
||||
description: "read session messages of the user"
|
||||
contextual_msg_count: 0
|
||||
read_memory:
|
||||
class: memory.operation.read_memory
|
||||
workflow: dummy
|
||||
workflow: dummy_worker
|
||||
description: "read related memories of the user"
|
||||
list_memory:
|
||||
class: memory.operation.read_memory
|
||||
workflow: dummy
|
||||
workflow: dummy_worker
|
||||
description: "read all memories of the user"
|
||||
write_memory:
|
||||
class: memory.operation.write_memory
|
||||
workflow: dummy
|
||||
workflow: dummy_worker
|
||||
description: "write observation memories of the user"
|
||||
interval_time: 60
|
||||
summary_memory:
|
||||
class: memory.operation.summary_memory
|
||||
workflow: dummy
|
||||
workflow: dummy_worker
|
||||
description: "summary observation memories of the user"
|
||||
interval_time: 300
|
||||
models:
|
||||
dashscope_generation:
|
||||
clazz: models.llama_index_generation_model
|
||||
module_name: DashScope
|
||||
module_name: dashscope_generation
|
||||
model_name: qwen-max
|
||||
dashscope_embedding:
|
||||
clazz: models.base_embedding_model
|
||||
module_name: DashScopeEmbedding
|
||||
clazz: models.llama_index_embedding_model
|
||||
module_name: dashscope_embedding
|
||||
model_name: text-embedding-v2
|
||||
dashscope_rank:
|
||||
clazz: models.base_rank_model
|
||||
module_name: DashScopeRerank
|
||||
module_name: dashscope_rank
|
||||
model_name: gte-rerank
|
||||
vector_store:
|
||||
clazz: storage.base_vector_store
|
||||
index_name: memory_test
|
||||
password: ''
|
||||
clazz: storage.dummy_vector_store
|
||||
embedding_model: dashscope_embedding
|
||||
monitor:
|
||||
clazz: storage.base_monitor
|
||||
index_name: memory_test
|
||||
clazz: storage.dummy_monitor
|
||||
workers:
|
||||
update_insight:
|
||||
clazz: worker.summary_long.update_insight
|
||||
dummy_worker:
|
||||
clazz: memory.worker.dummy_worker
|
||||
generation_model: dashscope_generation
|
||||
embedding_model: dashscope_embedding
|
||||
rank_model: dashscope_rank
|
||||
|
|
@ -16,7 +16,7 @@ class BaseModel(metaclass=ABCMeta):
|
|||
|
||||
def __init__(self,
|
||||
model_name: str,
|
||||
method_type: str,
|
||||
module_name: str,
|
||||
timeout: int = None,
|
||||
max_retries: int = 3,
|
||||
retry_interval: float = 1.0,
|
||||
|
|
@ -24,7 +24,7 @@ class BaseModel(metaclass=ABCMeta):
|
|||
**kwargs):
|
||||
|
||||
self.model_name: str = model_name
|
||||
self.method_type: str = method_type
|
||||
self.module_name: str = module_name
|
||||
self.timeout: int = timeout
|
||||
self.max_retries: int = max_retries
|
||||
self.retry_interval: float = retry_interval
|
||||
|
|
@ -33,9 +33,9 @@ class BaseModel(metaclass=ABCMeta):
|
|||
self.data = {}
|
||||
self.logger = Logger.get_logger()
|
||||
|
||||
obj_cls = MODEL_REGISTRY[self.method_type]
|
||||
obj_cls = MODEL_REGISTRY[self.module_name]
|
||||
if not obj_cls:
|
||||
raise RuntimeError(f"method_type={self.method_type} is not supported!")
|
||||
raise RuntimeError(f"method_type={self.module_name} is not supported!")
|
||||
|
||||
if kwargs_filter:
|
||||
allowed_kwargs = list(inspect.signature(obj_cls.__init__).parameters.keys())
|
||||
|
|
|
|||
12
memory_scope/storage/dummy_monitor.py
Normal file
12
memory_scope/storage/dummy_monitor.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from memory_scope.storage.base_monitor import BaseMonitor
|
||||
|
||||
|
||||
class DummyMonitor(BaseMonitor):
|
||||
def add(self):
|
||||
pass
|
||||
|
||||
def add_token(self):
|
||||
pass
|
||||
|
||||
def flush(self):
|
||||
pass
|
||||
24
memory_scope/storage/dummy_vector_store.py
Normal file
24
memory_scope/storage/dummy_vector_store.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from typing import Dict, List
|
||||
|
||||
from memory_scope.scheme.memory_node import MemoryNode
|
||||
from memory_scope.storage.base_vector_store import BaseVectorStore
|
||||
|
||||
|
||||
class DummyVectorStore(BaseVectorStore):
|
||||
def retrieve(self, query: str, top_k: int, filter_dict: Dict[str, List[str]]):
|
||||
pass
|
||||
|
||||
async def async_retrieve(self, query: str, top_k: int, filter_dict: Dict[str, List[str]]):
|
||||
pass
|
||||
|
||||
def insert(self, node: MemoryNode):
|
||||
pass
|
||||
|
||||
def insert_batch(self):
|
||||
pass
|
||||
|
||||
def delete(self):
|
||||
pass
|
||||
|
||||
def flush(self):
|
||||
pass
|
||||
Loading…
Add table
Reference in a new issue