mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-17 15:35:21 +02:00
update: set temperature for each action; add two basic skills
This commit is contained in:
parent
6d718735d2
commit
713e858c87
6 changed files with 16 additions and 6 deletions
|
|
@ -24,7 +24,8 @@ class DesignTask(Action):
|
|||
|
||||
def __init__(self, name="", context=None, llm=None):
|
||||
super().__init__(name, context, llm)
|
||||
self.llm.model = "gpt-3.5-turbo"
|
||||
self.llm.model = "gpt-3.5-turbo-16k"
|
||||
self.llm.temperature = 0.5
|
||||
|
||||
async def decompose_task(self, query, events):
|
||||
system_msgs = SystemMessage(
|
||||
|
|
@ -92,6 +93,7 @@ class DesignCurriculum(Action):
|
|||
def __init__(self, name="", context=None, llm=None):
|
||||
super().__init__(name, context, llm)
|
||||
self.llm.model = "gpt-3.5-turbo"
|
||||
self.llm.temperature = 0.5
|
||||
|
||||
async def generate_qa(self, events, qa_cache, qa_cache_questions_vectordb, game_memory, human_msg, system_msg):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class GenerateActionCode(Action):
|
|||
def __init__(self, name="", context=None, llm=None):
|
||||
super().__init__(name, context, llm)
|
||||
self.llm.model = "gpt-4"
|
||||
self.llm.temperature = 0.7
|
||||
|
||||
async def generate_code(self, human_msg, system_msg=[]):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -369,7 +369,9 @@ class GameEnvironment(BaseModel, arbitrary_types_allowed=True):
|
|||
"wait_ticks": 20,
|
||||
}
|
||||
)
|
||||
difficulty = "easy" if len(self.completed_tasks) > 15 else "peaceful"
|
||||
# difficulty = "easy" if len(self.completed_tasks) > 15 else "peaceful"
|
||||
difficulty = "peaceful"
|
||||
|
||||
events = self.mf_instance.step(
|
||||
"bot.chat(`/time set ${getNextTime()}`);\n"
|
||||
+ f"bot.chat('/difficulty {difficulty}');"
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter):
|
|||
def __init__(self, conf=CONFIG, **kwargs):
|
||||
self.__init_openai(conf)
|
||||
self.llm = openai
|
||||
self.temperature = 0.0
|
||||
self.model = conf.openai_api_model
|
||||
self.auto_max_tokens = False
|
||||
self._cost_manager = CostManager()
|
||||
|
|
@ -187,7 +188,7 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter):
|
|||
"max_tokens": self.get_max_tokens(messages),
|
||||
"n": 1,
|
||||
"stop": None,
|
||||
"temperature": 0.0,
|
||||
"temperature": self.temperature,
|
||||
"timeout": 3,
|
||||
}
|
||||
if CONFIG.openai_api_type == "azure":
|
||||
|
|
|
|||
|
|
@ -63,8 +63,8 @@ class ActionDeveloper(Base):
|
|||
"smeltItem",
|
||||
"killMob",
|
||||
]
|
||||
if not CONFIG.openai_api_model == "gpt-3.5-turbo":
|
||||
base_skills += [
|
||||
# if not CONFIG.openai_api_model == "gpt-3.5-turbo":
|
||||
base_skills += [
|
||||
"useChest",
|
||||
"mineflayer",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
import random
|
||||
import json
|
||||
|
||||
from ordered_set import OrderedSet
|
||||
|
||||
from metagpt.logs import logger
|
||||
from metagpt.schema import Message, HumanMessage, SystemMessage
|
||||
from metagpt.roles.minecraft.minecraft_base import Minecraft as Base
|
||||
|
|
@ -84,8 +86,10 @@ class CurriculumDesigner(Base):
|
|||
if self.game_memory.completed_tasks
|
||||
else "None"
|
||||
)
|
||||
|
||||
unique_failed_tasks = OrderedSet(self.game_memory.failed_tasks)
|
||||
failed_tasks = (
|
||||
"; ".join(self.game_memory.failed_tasks)
|
||||
"; ".join(unique_failed_tasks.items) #self.game_memory.failed_tasks
|
||||
if self.game_memory.failed_tasks
|
||||
else "None"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue