From 2a5b263371491a4be1799812d5dbd2f08c4c92c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Mon, 28 Aug 2023 22:09:40 +0800 Subject: [PATCH] fixbug: CONFIG initialization --- metagpt/roles/assistant.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/metagpt/roles/assistant.py b/metagpt/roles/assistant.py index 944b250f1..57cb28e67 100644 --- a/metagpt/roles/assistant.py +++ b/metagpt/roles/assistant.py @@ -20,12 +20,10 @@ from pathlib import Path from metagpt.actions import ActionOutput from metagpt.actions.skill_action import SkillAction, ArgumentsParingAction from metagpt.actions.talk_action import TalkAction -from metagpt.config import Config, CONFIG -from metagpt.const import BRAIN_MEMORY, SKILL_PATH +from metagpt.config import CONFIG from metagpt.learn.skill_loader import SkillLoader from metagpt.logs import logger from metagpt.memory.brain_memory import BrainMemory, MessageType -from metagpt.provider.openai_api import CostManager from metagpt.roles import Role from metagpt.schema import Message @@ -137,9 +135,8 @@ class Assistant(Role): async def main(): - cost_manager = CostManager() topic = "what's apple" - role = Assistant(cost_manager=cost_manager, language="Chinese") + role = Assistant(language="Chinese") await role.talk(topic) while True: has_action = await role.think()