mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-01 20:03:28 +02:00
commit
e783e5b208
61 changed files with 2353 additions and 248 deletions
|
|
@ -108,12 +108,6 @@ class RoleContext(BaseModel):
|
|||
) # see `Role._set_react_mode` for definitions of the following two attributes
|
||||
max_react_loop: int = 1
|
||||
|
||||
def check(self, role_id: str):
|
||||
# if hasattr(CONFIG, "enable_longterm_memory") and CONFIG.enable_longterm_memory:
|
||||
# self.long_term_memory.recover_memory(role_id, self)
|
||||
# self.memory = self.long_term_memory # use memory to act as long_term_memory for unify operation
|
||||
pass
|
||||
|
||||
@property
|
||||
def important_memory(self) -> list[Message]:
|
||||
"""Retrieve information corresponding to the attention action."""
|
||||
|
|
@ -311,8 +305,6 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
|
|||
buffer during _observe.
|
||||
"""
|
||||
self.rc.watch = {any_to_str(t) for t in actions}
|
||||
# check RoleContext after adding watch actions
|
||||
self.rc.check(self.role_id)
|
||||
|
||||
def is_watch(self, caused_by: str):
|
||||
return caused_by in self.rc.watch
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ from typing import Optional
|
|||
from pydantic import Field, model_validator
|
||||
|
||||
from metagpt.actions import SearchAndSummarize, UserRequirement
|
||||
from metagpt.document_store.base_store import BaseStore
|
||||
from metagpt.roles import Role
|
||||
from metagpt.tools.search_engine import SearchEngine
|
||||
|
||||
|
|
@ -27,7 +26,7 @@ class Sales(Role):
|
|||
"delivered with the professionalism and courtesy expected of a seasoned sales guide."
|
||||
)
|
||||
|
||||
store: Optional[BaseStore] = Field(default=None, exclude=True)
|
||||
store: Optional[object] = Field(default=None, exclude=True) # must inplement tools.SearchInterface
|
||||
|
||||
@model_validator(mode="after")
|
||||
def validate_stroe(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue