From 949a5074ce6240fb34b1f2bf00771ab7375fc9c6 Mon Sep 17 00:00:00 2001 From: rainyrfeng Date: Thu, 31 Aug 2023 11:05:59 +0800 Subject: [PATCH 01/22] fix feature --- config/config.yaml | 3 ++- metagpt/config.py | 1 + metagpt/provider/openai_api.py | 11 +++++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 274cdf469..428f8dae4 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -16,11 +16,12 @@ RPM: 10 #Anthropic_API_KEY: "YOUR_API_KEY" #### if AZURE, check https://github.com/openai/openai-cookbook/blob/main/examples/azure/chat.ipynb - +#### You can use ENGINE or DEPLOYMENT mode #OPENAI_API_TYPE: "azure" #OPENAI_API_BASE: "YOUR_AZURE_ENDPOINT" #OPENAI_API_KEY: "YOUR_AZURE_API_KEY" #OPENAI_API_VERSION: "YOUR_AZURE_API_VERSION" +#OPENAI_API_ENGINE: "YOUR_OPENAI_API_ENGINE" #DEPLOYMENT_ID: "YOUR_DEPLOYMENT_ID" #### for Search diff --git a/metagpt/config.py b/metagpt/config.py index 2c1096877..16c4117cd 100644 --- a/metagpt/config.py +++ b/metagpt/config.py @@ -56,6 +56,7 @@ class Config(metaclass=Singleton): openai.api_base = self.openai_api_base self.openai_api_type = self._get("OPENAI_API_TYPE") self.openai_api_version = self._get("OPENAI_API_VERSION") + self.openai_api_engine = self._get('OPENAI_API_ENGINE') self.openai_api_rpm = self._get("RPM", 3) self.openai_api_model = self._get("OPENAI_API_MODEL", "gpt-4") self.max_tokens_rsp = self._get("MAX_TOKENS", 2048) diff --git a/metagpt/provider/openai_api.py b/metagpt/provider/openai_api.py index 79121c8de..7ef694a98 100644 --- a/metagpt/provider/openai_api.py +++ b/metagpt/provider/openai_api.py @@ -156,10 +156,12 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): # iterate through the stream of events async for chunk in response: collected_chunks.append(chunk) # save the event response - chunk_message = chunk["choices"][0]["delta"] # extract the message - collected_messages.append(chunk_message) # save the message - if "content" in chunk_message: - print(chunk_message["content"], end="") + choices = chunk["choices"] + if len(choices) > 0: + chunk_message = chunk["choices"][0].get("delta", {}) # extract the message + collected_messages.append(chunk_message) # save the message + if "content" in chunk_message: + print(chunk_message["content"], end="") print() full_reply_content = "".join([m.get("content", "") for m in collected_messages]) @@ -170,6 +172,7 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): def _cons_kwargs(self, messages: list[dict]) -> dict: if CONFIG.openai_api_type == "azure": kwargs = { + "engine": CONFIG.openai_api_engine, "deployment_id": CONFIG.deployment_id, "messages": messages, "max_tokens": self.get_max_tokens(messages), From 689aa935eb87861fb9c2d647e180ddd2ee00618c Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Mon, 4 Sep 2023 19:19:37 +0800 Subject: [PATCH 02/22] Update startup.py set default params --- startup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/startup.py b/startup.py index 611317fd4..e6d5fc4e9 100644 --- a/startup.py +++ b/startup.py @@ -44,9 +44,9 @@ def main( idea: str, investment: float = 3.0, n_round: int = 5, - code_review: bool = False, + code_review: bool = True, run_tests: bool = False, - implement: bool = False + implement: bool = True ): """ We are a software startup comprised of AI. By investing in us, @@ -66,4 +66,4 @@ def main( if __name__ == '__main__': fire.Fire(main) - \ No newline at end of file + From 26fbbfc83c83f9f5c5515bcc3dd1782688de3d90 Mon Sep 17 00:00:00 2001 From: stellahsr Date: Mon, 4 Sep 2023 19:51:28 +0800 Subject: [PATCH 03/22] rm useless files --- Message | 0 None | 0 int | 0 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Message delete mode 100644 None delete mode 100644 int diff --git a/Message b/Message deleted file mode 100644 index e69de29bb..000000000 diff --git a/None b/None deleted file mode 100644 index e69de29bb..000000000 diff --git a/int b/int deleted file mode 100644 index e69de29bb..000000000 From a0be280879024fb7e422ca7dafa95491211721df Mon Sep 17 00:00:00 2001 From: rainyrfeng Date: Tue, 5 Sep 2023 11:26:16 +0800 Subject: [PATCH 04/22] fix feature --- metagpt/provider/openai_api.py | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/metagpt/provider/openai_api.py b/metagpt/provider/openai_api.py index 752fbb4dd..11e35b114 100644 --- a/metagpt/provider/openai_api.py +++ b/metagpt/provider/openai_api.py @@ -176,25 +176,23 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): return full_reply_content def _cons_kwargs(self, messages: list[dict]) -> dict: + kwargs = { + "messages": messages, + "max_tokens": self.get_max_tokens(messages), + "n": 1, + "stop": None, + "temperature": 0.3, + } if CONFIG.openai_api_type == "azure": - kwargs = { - "engine": CONFIG.openai_api_engine, - "deployment_id": CONFIG.deployment_id, - "messages": messages, - "max_tokens": self.get_max_tokens(messages), - "n": 1, - "stop": None, - "temperature": 0.3, - } + if CONFIG.openai_api_engine and CONFIG.deployment_id: + raise ValueError("You can only use one of the `deployment_id` or `engine` model") + elif not CONFIG.openai_api_engine and not CONFIG.deployment_id: + raise ValueError("You must specify `OPENAI_API_ENGINE` or `DEPLOYMENT_ID` parameter") + kwargs_mode = {"engine": CONFIG.openai_api_engine} if CONFIG.openai_api_engine \ + else {"deployment_id": CONFIG.deployment_id} else: - kwargs = { - "model": self.model, - "messages": messages, - "max_tokens": self.get_max_tokens(messages), - "n": 1, - "stop": None, - "temperature": 0.3, - } + kwargs_mode = {"model": self.model} + kwargs.update(kwargs_mode) kwargs["timeout"] = 3 return kwargs From 864a66c7024d89994fcfe677703173f3db8a567d Mon Sep 17 00:00:00 2001 From: rainyrfeng Date: Tue, 5 Sep 2023 20:36:32 +0800 Subject: [PATCH 05/22] fix feature --- config/config.yaml | 2 +- metagpt/config.py | 2 +- metagpt/provider/openai_api.py | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 428f8dae4..4519288d3 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -21,7 +21,7 @@ RPM: 10 #OPENAI_API_BASE: "YOUR_AZURE_ENDPOINT" #OPENAI_API_KEY: "YOUR_AZURE_API_KEY" #OPENAI_API_VERSION: "YOUR_AZURE_API_VERSION" -#OPENAI_API_ENGINE: "YOUR_OPENAI_API_ENGINE" +#DEPLOYMENT_NAME: "YOUR_DEPLOYMENT_NAME" #DEPLOYMENT_ID: "YOUR_DEPLOYMENT_ID" #### for Search diff --git a/metagpt/config.py b/metagpt/config.py index 7ac32f4d0..96f402b38 100644 --- a/metagpt/config.py +++ b/metagpt/config.py @@ -56,10 +56,10 @@ class Config(metaclass=Singleton): openai.api_base = self.openai_api_base self.openai_api_type = self._get("OPENAI_API_TYPE") self.openai_api_version = self._get("OPENAI_API_VERSION") - self.openai_api_engine = self._get('OPENAI_API_ENGINE') self.openai_api_rpm = self._get("RPM", 3) self.openai_api_model = self._get("OPENAI_API_MODEL", "gpt-4") self.max_tokens_rsp = self._get("MAX_TOKENS", 2048) + self.deployment_name = self._get('DEPLOYMENT_NAME') self.deployment_id = self._get("DEPLOYMENT_ID") self.claude_api_key = self._get("Anthropic_API_KEY") diff --git a/metagpt/provider/openai_api.py b/metagpt/provider/openai_api.py index 11e35b114..ad9df0396 100644 --- a/metagpt/provider/openai_api.py +++ b/metagpt/provider/openai_api.py @@ -182,18 +182,18 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): "n": 1, "stop": None, "temperature": 0.3, + "timeout": 3 } if CONFIG.openai_api_type == "azure": - if CONFIG.openai_api_engine and CONFIG.deployment_id: - raise ValueError("You can only use one of the `deployment_id` or `engine` model") - elif not CONFIG.openai_api_engine and not CONFIG.deployment_id: - raise ValueError("You must specify `OPENAI_API_ENGINE` or `DEPLOYMENT_ID` parameter") - kwargs_mode = {"engine": CONFIG.openai_api_engine} if CONFIG.openai_api_engine \ + if CONFIG.deployment_name and CONFIG.deployment_id: + raise ValueError("You can only use one of the `deployment_id` or `deployment_name` model") + elif not CONFIG.deployment_name and not CONFIG.deployment_id: + raise ValueError("You must specify `DEPLOYMENT_NAME` or `DEPLOYMENT_ID` parameter") + kwargs_mode = {"engine": CONFIG.deployment_name} if CONFIG.deployment_name \ else {"deployment_id": CONFIG.deployment_id} else: kwargs_mode = {"model": self.model} kwargs.update(kwargs_mode) - kwargs["timeout"] = 3 return kwargs async def _achat_completion(self, messages: list[dict]) -> dict: From c0aab24b291eb7e2f5e7dd71e3ef8aa01c044706 Mon Sep 17 00:00:00 2001 From: Chen Zhang Date: Wed, 6 Sep 2023 17:47:35 +0800 Subject: [PATCH 06/22] 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 23686efe031af165be9ea550700ec4b5b4369357 Mon Sep 17 00:00:00 2001 From: gallonyin Date: Wed, 6 Sep 2023 20:19:23 +0800 Subject: [PATCH 07/22] =?UTF-8?q?Fix=20README=5FCN.md=20=E2=80=9C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E9=94=99=E8=AF=AF=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 2180eb518..4a1f0c44e 100644 --- a/docs/README_CN.md +++ b/docs/README_CN.md @@ -115,7 +115,7 @@ ## 示例:启动一个创业公司 ```shell python startup.py "写一个命令行贪吃蛇" -# 开启code review模式会会花费更多的money, 但是会提升代码质量和成功率 +# 开启code review模式会花费更多的money, 但是会提升代码质量和成功率 python startup.py "写一个命令行贪吃蛇" --code_review True ``` From 9f5ff2fb7d802adc0c29bf40119f943d732ceabb Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:36:44 +0800 Subject: [PATCH 08/22] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 84dafa46b..5998adbb1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ # MetaGPT: The Multi-Agent Framework Discord Follow License: MIT roadmap -roadmap Twitter Follow

From c1afa18882202bb720a1f48ff09edcef1496837c Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:41:47 +0800 Subject: [PATCH 09/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5998adbb1..b35291e56 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ # MetaGPT: The Multi-Agent Framework CN doc EN doc JA doc -Discord Follow +Discord License: MIT roadmap Twitter Follow From 813366f3e35e635b25e1d579cbcbe668322b6e52 Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 21:42:06 +0800 Subject: [PATCH 10/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b35291e56..5998adbb1 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ # MetaGPT: The Multi-Agent Framework CN doc EN doc JA doc -Discord +Discord Follow License: MIT roadmap Twitter Follow From 68b7118aed372879e44c304a29ddbe8b22202077 Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:07:22 +0800 Subject: [PATCH 11/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5998adbb1..dfb04cedf 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ # MetaGPT: The Multi-Agent Framework CN doc EN doc JA doc -Discord Follow +Discord Follow License: MIT roadmap Twitter Follow From 3cc5503ab46241eba57a346861ffebb87c1a949c Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:27:10 +0800 Subject: [PATCH 12/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index dfb04cedf..7623fde3f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ # MetaGPT: The Multi-Agent Framework CN doc EN doc JA doc -Discord Follow +Discord Follow License: MIT roadmap Twitter Follow From c5903eff8a77af362f18f8f3d723fb6045d7e871 Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:28:46 +0800 Subject: [PATCH 13/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7623fde3f..a3f669d7b 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ # MetaGPT: The Multi-Agent Framework CN doc EN doc JA doc -Discord Follow +Discord Follow License: MIT roadmap Twitter Follow From 8e0b9308a8b5c6a528911609ea3f24b5875b385d Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:30:59 +0800 Subject: [PATCH 14/22] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a3f669d7b..2c0c1757a 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ # MetaGPT: The Multi-Agent Framework

+ ![Python 3.9+](https://img.shields.io/badge/Python-3.9%2B-brightgreen.svg) Open in Dev Containers Open in GitHub Codespaces

From 5158ede41f618d8ef44d0b6c10722cc86b8888d7 Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:31:49 +0800 Subject: [PATCH 15/22] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c0c1757a..8934f48f8 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ # MetaGPT: The Multi-Agent Framework

- ![Python 3.9+](https://img.shields.io/badge/Python-3.9%2B-brightgreen.svg) + Open in Dev Containers Open in GitHub Codespaces

From 034a133817a9a4d23cd9a119665588ac469f0d49 Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:34:44 +0800 Subject: [PATCH 16/22] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 8934f48f8..a3f669d7b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ # MetaGPT: The Multi-Agent Framework

- Open in Dev Containers Open in GitHub Codespaces

From b90e16e74565906699e08b8dac2be1e5db20b5e4 Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:34:57 +0800 Subject: [PATCH 17/22] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a3f669d7b..8934f48f8 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ # MetaGPT: The Multi-Agent Framework

+ Open in Dev Containers Open in GitHub Codespaces

From 76fe10ca0a2c047e38f84cb0729aaf379e1cbaab Mon Sep 17 00:00:00 2001 From: stellaHSR <34952977+stellaHSR@users.noreply.github.com> Date: Wed, 6 Sep 2023 23:37:37 +0800 Subject: [PATCH 18/22] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 8934f48f8..a3f669d7b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ # MetaGPT: The Multi-Agent Framework

- Open in Dev Containers Open in GitHub Codespaces

From eb7a8f5287992b0d15bdf2d76a58a91e5fd59e63 Mon Sep 17 00:00:00 2001 From: ushio0107 Date: Wed, 6 Sep 2023 23:57:46 +0800 Subject: [PATCH 19/22] 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 20/22] 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 21/22] 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 22/22] 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}"