From 46bce295cab987dc5e73b9dadcf21a1fdda9f1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Tue, 13 Aug 2024 13:43:46 +0800 Subject: [PATCH] =?UTF-8?q?fixbug:=20linux=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8Fkey=E4=B8=8D=E8=83=BD=E4=BD=BF=E7=94=A8-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metagpt/prompts/di/role_zero.py | 4 ++-- metagpt/tools/libs/env.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/metagpt/prompts/di/role_zero.py b/metagpt/prompts/di/role_zero.py index 49ad7a05b..b6faa8cb3 100644 --- a/metagpt/prompts/di/role_zero.py +++ b/metagpt/prompts/di/role_zero.py @@ -152,7 +152,7 @@ Respond with a concise thought, then provide the appropriate response category: """ -QUICK_THINK_EXAMPLES =""" +QUICK_THINK_EXAMPLES = """ # Example 1. Request: "How do I design an online document editing platform that supports real-time collaboration?" @@ -190,4 +190,4 @@ Response Category: AMBIGUOUS. # Instruction """ -QUICK_THINK_PROMPT = QUICK_THINK_PROMPT.format(examples=QUICK_THINK_EXAMPLES) \ No newline at end of file +QUICK_THINK_PROMPT = QUICK_THINK_PROMPT.format(examples=QUICK_THINK_EXAMPLES) diff --git a/metagpt/tools/libs/env.py b/metagpt/tools/libs/env.py index 1fa265d07..c1757c5f9 100644 --- a/metagpt/tools/libs/env.py +++ b/metagpt/tools/libs/env.py @@ -31,6 +31,10 @@ async def default_get_env(key: str, app_name: str = None) -> str: if app_key in os.environ: return os.environ[app_key] + env_app_key = app_key.replace("-", "_") # "-" is not supported by linux environment variable + if env_app_key in os.environ: + return os.environ[env_app_key] + from metagpt.context import Context context = Context()