From 2363f94e8d53d3078d0431d17204e95fbf8f44d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Tue, 7 May 2024 10:34:04 +0800 Subject: [PATCH] feat: +acknowledge --- tests/metagpt/tools/libs/test_software_development.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/metagpt/tools/libs/test_software_development.py b/tests/metagpt/tools/libs/test_software_development.py index a35f40fe1..cff419f11 100644 --- a/tests/metagpt/tools/libs/test_software_development.py +++ b/tests/metagpt/tools/libs/test_software_development.py @@ -1,5 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from typing import Dict import pytest @@ -9,6 +10,10 @@ from metagpt.schema import UserMessage from metagpt.tools.libs.software_development import import_git_repo +async def get_env_description() -> Dict[str, str]: + return {'await get_env(key="access_token", app_name="github")': "get the access token for github authentication."} + + @pytest.mark.skip @pytest.mark.asyncio async def test_import_repo(): @@ -31,6 +36,9 @@ async def test_git_create_issue(content: str): prerequisite = "from metagpt.tools.libs import get_env" await di.execute_code.run(code=prerequisite, language="python") + usage = await get_env_description() + acknowledge = [f"- You can use `{k}` to '{v}'" for k, v in usage.items()] + content += "\n---\n## Acknowledge\n" + "\n".join(acknowledge) di.put_message(UserMessage(content=content)) while not di.is_idle: await di.run()