mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
add residue code
This commit is contained in:
parent
194744348a
commit
4893acb24f
4 changed files with 21 additions and 3 deletions
|
|
@ -5,7 +5,7 @@
|
|||
from typing import Optional
|
||||
|
||||
import requests
|
||||
from pydantic import Field, model_validator, ConfigDict
|
||||
from pydantic import ConfigDict, Field, model_validator
|
||||
|
||||
from metagpt.const import (
|
||||
MC_CKPT_DIR,
|
||||
|
|
|
|||
|
|
@ -2,8 +2,20 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Desc : MG Software Env
|
||||
|
||||
from metagpt.env.base_env import Env
|
||||
from pydantic import ConfigDict, Field, SerializeAsAny
|
||||
|
||||
from metagpt.environment.base_env import Env
|
||||
|
||||
|
||||
class SoftwareEnv(Env):
|
||||
pass
|
||||
"""环境,承载一批角色,角色可以向环境发布消息,可以被其他角色观察到
|
||||
Environment, hosting a batch of roles, roles can publish messages to the environment, and can be observed by other roles
|
||||
"""
|
||||
|
||||
model_config = ConfigDict(arbitrary_types_allowed=True)
|
||||
|
||||
desc: str = Field(default="") # 环境描述
|
||||
roles: dict[str, SerializeAsAny[Role]] = Field(default_factory=dict, validate_default=True)
|
||||
member_addrs: dict[Role, Set] = Field(default_factory=dict, exclude=True)
|
||||
history: str = "" # For debug
|
||||
context: Context = Field(default_factory=Context, exclude=True)
|
||||
|
|
|
|||
3
tests/metagpt/environment/gym_env/__init__.py
Normal file
3
tests/metagpt/environment/gym_env/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Desc :
|
||||
3
tests/metagpt/environment/software_env/__init__.py
Normal file
3
tests/metagpt/environment/software_env/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# @Desc :
|
||||
Loading…
Add table
Add a link
Reference in a new issue