Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

add residue code

better6294893acb24f56
diff --git a/metagpt/environment/mincraft_env/mincraft_ext_env.py b/metagpt/environment/mincraft_env/mincraft_ext_env.py
index eb7225acf..fcdeb48e0 100644
--- a/metagpt/environment/mincraft_env/mincraft_ext_env.py
+++ b/metagpt/environment/mincraft_env/mincraft_ext_env.py
@@ -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,
diff --git a/metagpt/environment/software_env/software_env.py b/metagpt/environment/software_env/software_env.py
index 53c832071..60d09b551 100644
--- a/metagpt/environment/software_env/software_env.py
+++ b/metagpt/environment/software_env/software_env.py
@@ -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)
diff --git a/tests/metagpt/environment/gym_env/__init__.py b/tests/metagpt/environment/gym_env/__init__.py
new file mode 100644
index 000000000..2bcf8efd0
--- /dev/null
+++ b/tests/metagpt/environment/gym_env/__init__.py
@@ -0,0 +1,3 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Desc :
diff --git a/tests/metagpt/environment/software_env/__init__.py b/tests/metagpt/environment/software_env/__init__.py
new file mode 100644
index 000000000..2bcf8efd0
--- /dev/null
+++ b/tests/metagpt/environment/software_env/__init__.py
@@ -0,0 +1,3 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# @Desc :