feat: new_tid -> new_transaction_id

This commit is contained in:
莘权 马 2024-08-19 21:15:10 +08:00
parent 4756f48406
commit 4a3df70310
3 changed files with 4 additions and 4 deletions

View file

@ -19,7 +19,7 @@ __all__ = [
"read_docx",
"Singleton",
"TOKEN_COSTS",
"new_tid",
"new_transaction_id",
"count_message_tokens",
"count_string_tokens",
]

View file

@ -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.

View file

@ -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