From c0aab24b291eb7e2f5e7dd71e3ef8aa01c044706 Mon Sep 17 00:00:00 2001 From: Chen Zhang Date: Wed, 6 Sep 2023 17:47:35 +0800 Subject: [PATCH 1/5] fix: windows compatibility --- metagpt/utils/common.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/metagpt/utils/common.py b/metagpt/utils/common.py index 7f090cf63..a0dabd77e 100644 --- a/metagpt/utils/common.py +++ b/metagpt/utils/common.py @@ -9,6 +9,7 @@ import ast import contextlib import inspect import os +import platform import re from typing import List, Tuple @@ -20,7 +21,10 @@ def check_cmd_exists(command) -> int: :param command: 待检查的命令 :return: 如果命令存在,返回0,如果不存在,返回非0 """ - check_command = 'command -v ' + command + ' >/dev/null 2>&1 || { echo >&2 "no mermaid"; exit 1; }' + if platform.system().lower() == 'windows': + check_command = 'where ' + command + else: + check_command = 'command -v ' + command + ' >/dev/null 2>&1 || { echo >&2 "no mermaid"; exit 1; }' result = os.system(check_command) return result From eb7a8f5287992b0d15bdf2d76a58a91e5fd59e63 Mon Sep 17 00:00:00 2001 From: ushio0107 Date: Wed, 6 Sep 2023 23:57:46 +0800 Subject: [PATCH 2/5] Update README_CN.md --- docs/README_CN.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/README_CN.md b/docs/README_CN.md index 2180eb518..dda5f15eb 100644 --- a/docs/README_CN.md +++ b/docs/README_CN.md @@ -53,6 +53,25 @@ # 第 3 步:克隆仓库到您的本地机器,并进行安装。 python setup.py install ``` +**注意:** + +- 如果已经安装了Chrome、Chromium或MS Edge,可以通过将环境变量`PUPPETEER_SKIP_CHROMIUM_DOWNLOAD`设置为`true`来跳过下载Chromium。 + +- 一些人在全局安装此工具时遇到问题。在本地安装是替代解决方案, + + ```bash + npm install @mermaid-js/mermaid-cli + ``` + +- 不要忘记在config.yml中为mmdc配置配置, + + ```yml + PUPPETEER_CONFIG: "./config/puppeteer-config.json" + MMDC: "./node_modules/.bin/mmdc" + ``` + +- 如果`python setup.py install`失败并显示错误`[Errno 13] Permission denied: '/usr/local/lib/python3.11/dist-packages/test-easy-install-13129.write-test'`,请尝试使用`python setup.py install --user`运行。 + ### Docker安装 ```bash @@ -115,7 +134,7 @@ ## 示例:启动一个创业公司 ```shell python startup.py "写一个命令行贪吃蛇" -# 开启code review模式会会花费更多的money, 但是会提升代码质量和成功率 +# 开启code review模式会会花费更多的金钱, 但是会提升代码质量和成功率 python startup.py "写一个命令行贪吃蛇" --code_review True ``` From 207485e24a9d068fc301741558c55a5661861406 Mon Sep 17 00:00:00 2001 From: ushio0107 Date: Thu, 7 Sep 2023 00:09:40 +0800 Subject: [PATCH 3/5] Update README_CN.md --- docs/README_CN.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/README_CN.md b/docs/README_CN.md index dda5f15eb..8e994e664 100644 --- a/docs/README_CN.md +++ b/docs/README_CN.md @@ -142,7 +142,6 @@ # 开启code review模式会会花费更多的金钱, 但是会提升代码质 ### 平台或工具的倾向性 可以在阐述需求时说明想要使用的平台或工具。 例如: - ```shell python startup.py "写一个基于pygame的命令行贪吃蛇" ``` From 4973364556da056476c56874f7cfea0e9f190a4e Mon Sep 17 00:00:00 2001 From: ushio0107 Date: Thu, 7 Sep 2023 13:55:07 +0800 Subject: [PATCH 4/5] Update README_CN.md --- docs/README_CN.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README_CN.md b/docs/README_CN.md index 8e994e664..ae5d954e4 100644 --- a/docs/README_CN.md +++ b/docs/README_CN.md @@ -134,7 +134,7 @@ ## 示例:启动一个创业公司 ```shell python startup.py "写一个命令行贪吃蛇" -# 开启code review模式会会花费更多的金钱, 但是会提升代码质量和成功率 +# 开启code review模式会花费更多的金钱, 但是会提升代码质量和成功率 python startup.py "写一个命令行贪吃蛇" --code_review True ``` From a90c4309a0dba269e72192521c111c8d316adea6 Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Sun, 10 Sep 2023 23:17:58 +0800 Subject: [PATCH 5/5] Update prompt.py fixquotes error --- metagpt/roles/prompt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metagpt/roles/prompt.py b/metagpt/roles/prompt.py index d13551203..c22e0226b 100644 --- a/metagpt/roles/prompt.py +++ b/metagpt/roles/prompt.py @@ -32,7 +32,7 @@ class PromptString(Enum): RECENT_ACTIVITY = "Based on the following memory, produce a brief summary of what {full_name} has been up to recently. Do not invent details not explicitly stated in the memory. For any conversation, be sure to mention whether the conversation has concluded or is still ongoing.\n\nMemory: {memory_descriptions}" - MAKE_PLANS = 'You are a plan-generating AI. Your job is to assist the character in formulating new plans based on new information. Given the character's information (profile, objectives, recent activities, current plans, and location context) and their current thought process, produce a new set of plans for them. The final plan should comprise at least {time_window} of activities and no more than 5 individual plans. List the plans in the order they should be executed, with each plan detailing its description, location, start time, stop criteria, and maximum duration.\n\nSample plan: \'{{"index": 1, "description": "Cook dinner", "location_id": "0a3bc22b-36aa-48ab-adb0-18616004caed","start_time": "2022-12-12T20:00:00+00:00","max_duration_hrs": 1.5, "stop_condition": "Dinner is fully prepared"}}\'\n\nFor each plan, choose the most appropriate location name from this list: {allowed_location_descriptions}\n\n{format_instructions}\n\nAlways prioritize completing any unfinished conversations.\n\nLet's begin!\n\nName: {full_name}\nProfile: {private_bio}\nObjectives: {directives}\nLocation Context: {location_context}\nCurrent Plans: {current_plans}\nRecent Activities: {recent_activity}\nThought Process: {thought_process}\nIt's essential to encourage the character to collaborate with other characters in their plans.\n\n' + MAKE_PLANS = "You are a plan-generating AI. Your job is to assist the character in formulating new plans based on new information. Given the character's information (profile, objectives, recent activities, current plans, and location context) and their current thought process, produce a new set of plans for them. The final plan should comprise at least {time_window} of activities and no more than 5 individual plans. List the plans in the order they should be executed, with each plan detailing its description, location, start time, stop criteria, and maximum duration.\n\nSample plan: {{\"index\": 1, \"description\": \"Cook dinner\", \"location_id\": \"0a3bc22b-36aa-48ab-adb0-18616004caed\",\"start_time\": \"2022-12-12T20:00:00+00:00\",\"max_duration_hrs\": 1.5, \"stop_condition\": \"Dinner is fully prepared\"}}\'\n\nFor each plan, choose the most appropriate location name from this list: {allowed_location_descriptions}\n\n{format_instructions}\n\nAlways prioritize completing any unfinished conversations.\n\nLet's begin!\n\nName: {full_name}\nProfile: {private_bio}\nObjectives: {directives}\nLocation Context: {location_context}\nCurrent Plans: {current_plans}\nRecent Activities: {recent_activity}\nThought Process: {thought_process}\nIt's essential to encourage the character to collaborate with other characters in their plans.\n\n" EXECUTE_PLAN = "You are a role-playing AI, playing the role of {your_name}, in front of a live audience. Every word you say can be observed by the audience, so make sure you speak often and make it interesting. You cannot interact directly with the audience.\n\nBased on the following context and tools, proceed as if you are {your_name}. Your primary task is to complete the task given below, however, if you are currently in a conversation with another character, you should always complete the conversation first and then proceed with the task. Do not start working while you are engaged in an unfinished conversation. Use your best judgment to determine whether a conversation involves you and whether it is unfinished. You don't need to respond to every message you receive.\n\nThis is a personal profile of your character:\n{your_private_bio}\n\nThis is a description of your location and other nearby characters you can converse with:\n\n{location_context}\n\nThese are some relevant memories:\n```\n{relevant_memories}\n```\n\nThis is some relevant conversation history:\n```\n{conversation_history}\n```\n\nThese are the tools you can use:\n{tools}\n\nYour response should follow the format below:\n\nTask: The task you must complete\nThoughts: What you should think about doing\nAction: The action to take, must be one of these words: [{tool_names}]\nAction Input: Input for the action\nObservation: The result of the action\n... (This Thoughts/Action/Action Input/Observation can be repeated N times)\nThoughts: 'I have completed the task'\nFinal Response: The final response to the task\n\nIf you are not ready with a final response, then you must take an action.\n\nIf you are certain that you cannot complete the task with the tools provided, return 'Final Response: Need Help', however, if you are in conversation with another character, responses like 'I don't know' are valid. During conversations, you should never break character or admit you are an AI.\nIf the task is completed and no specific response is required, return 'Final Response: Done'\nLet's begin!\n\nTask: {input}\n\n{agent_scratchpad}"