diff --git a/metagpt/utils/__init__.py b/metagpt/utils/__init__.py index 1c907f36f..26042eb0e 100644 --- a/metagpt/utils/__init__.py +++ b/metagpt/utils/__init__.py @@ -19,7 +19,7 @@ __all__ = [ "read_docx", "Singleton", "TOKEN_COSTS", - "new_tid", + "new_transaction_id", "count_message_tokens", "count_string_tokens", ] diff --git a/metagpt/utils/common.py b/metagpt/utils/common.py index b6a1756c4..2b2a209be 100644 --- a/metagpt/utils/common.py +++ b/metagpt/utils/common.py @@ -1090,7 +1090,7 @@ def tool2name(cls, methods: List[str], entry) -> Dict[str, Any]: return mappings -def new_tid(postfix_len=8) -> str: +def new_transaction_id(postfix_len=8) -> str: """ Generates a new unique transaction ID based on current timestamp and a random UUID. diff --git a/tests/metagpt/utils/test_mermaid.py b/tests/metagpt/utils/test_mermaid.py index 2aa60a6ee..1fbf060fe 100644 --- a/tests/metagpt/utils/test_mermaid.py +++ b/tests/metagpt/utils/test_mermaid.py @@ -9,7 +9,7 @@ import pytest from metagpt.const import DEFAULT_WORKSPACE_ROOT -from metagpt.utils.common import check_cmd_exists, new_tid +from metagpt.utils.common import check_cmd_exists, new_transaction_id from metagpt.utils.mermaid import MMC1, mermaid_to_file @@ -23,7 +23,7 @@ async def test_mermaid(engine, suffixes, context, mermaid_mocker): # playwright prerequisites: playwright install --with-deps chromium assert check_cmd_exists("npm") == 0 - save_to = DEFAULT_WORKSPACE_ROOT / f"{new_tid()}/{engine}/1" + save_to = DEFAULT_WORKSPACE_ROOT / f"{new_transaction_id()}/{engine}/1" await mermaid_to_file(engine, MMC1, save_to, suffixes=suffixes) # ink does not support pdf