From 950937d9826448d087383832d77e07075c5e7a5c Mon Sep 17 00:00:00 2001 From: RexWang <62223937+RexWzh@users.noreply.github.com> Date: Sun, 23 Jun 2024 09:35:57 +0800 Subject: [PATCH] fix print log (#84) --- chattool/chattype.py | 1 + tests/test_chattool.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/chattool/chattype.py b/chattool/chattype.py index 12f1b02..739e367 100644 --- a/chattool/chattype.py +++ b/chattool/chattype.py @@ -196,6 +196,7 @@ def display_role_content(dic:dict, sep:Union[str, None]=None): return f"{sep}{role}{sep}calling tool:\n{pformat(tools)}" if 'function_call' in dic: return f"{sep}{role}{sep}calling function:\n{pformat(dic['function_call'])}" + return f"{sep}{role}{sep}{content}" else: raise Exception(f"Unknown role {role}") diff --git a/tests/test_chattool.py b/tests/test_chattool.py index aa05720..5520492 100644 --- a/tests/test_chattool.py +++ b/tests/test_chattool.py @@ -196,7 +196,6 @@ def test_error_message(): assert resp.error_code == "invalid_api_key" assert resp.is_valid() == False - def test_usage(): resp = Resp(response=response) assert resp.total_tokens == 18