mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-21 14:05:17 +02:00
fixbug: #1031
This commit is contained in:
parent
e40fc66f98
commit
9a51038bd1
2 changed files with 3 additions and 1 deletions
|
|
@ -129,8 +129,8 @@ class Environment(ExtEnv):
|
|||
self.roles[role.profile] = role
|
||||
|
||||
for role in roles: # setup system message with roles
|
||||
role.set_env(self)
|
||||
role.context = self.context
|
||||
role.set_env(self)
|
||||
|
||||
def publish_message(self, message: Message, peekable: bool = True) -> bool:
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
|
|||
|
||||
self._check_actions()
|
||||
self.llm.system_prompt = self._get_prefix()
|
||||
self.llm.cost_manager = self.context.cost_manager
|
||||
self._watch(kwargs.pop("watch", [UserRequirement]))
|
||||
|
||||
if self.latest_observed_msg:
|
||||
|
|
@ -331,6 +332,7 @@ class Role(SerializationMixin, ContextMixin, BaseModel):
|
|||
if env:
|
||||
env.set_addresses(self, self.addresses)
|
||||
self.llm.system_prompt = self._get_prefix()
|
||||
self.llm.cost_manager = self.context.cost_manager
|
||||
self.set_actions(self.actions) # reset actions to update llm and prefix
|
||||
|
||||
def _get_prefix(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue