mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 18:18:08 +00:00
fix: tool name in agent builder
This commit is contained in:
1 parent
06e827573c
commit
ed34c2b929
6 files changed
+54
-7
No files matched your search
@@ -150,6 +150,26 @@ class TestResolveToolDetails:
|
||||
|
||||
assert result[0]["display_name"] == "test_tool"
|
||||
|
||||
def test_prefers_custom_name_when_present(self, mock_mongo_db):
|
||||
from application.api.user.base import resolve_tool_details
|
||||
from application.core.settings import settings
|
||||
|
||||
user_tools = mock_mongo_db[settings.MONGO_DB_NAME]["user_tools"]
|
||||
tool_id = ObjectId()
|
||||
|
||||
user_tools.insert_one(
|
||||
{
|
||||
"_id": tool_id,
|
||||
"name": "calculator",
|
||||
"displayName": "Calculator Tool",
|
||||
"customName": "Math Wizard",
|
||||
}
|
||||
)
|
||||
|
||||
result = resolve_tool_details([str(tool_id)])
|
||||
|
||||
assert result[0]["display_name"] == "Math Wizard"
|
||||
|
||||
def test_empty_tool_ids_list(self, mock_mongo_db):
|
||||
from application.api.user.base import resolve_tool_details
|
||||
|
||||
|
||||
Reference in new issue
Block a user