tools系统

This commit is contained in:
UnCLAS-Prommer
2025-07-31 11:41:15 +08:00
parent 483c8fb547
commit 37e52a1566
10 changed files with 95 additions and 323 deletions

View File

@@ -14,14 +14,10 @@ class SearchKnowledgeTool(BaseTool):
name = "search_knowledge"
description = "使用工具从知识库中搜索相关信息"
parameters = {
"type": "object",
"properties": {
"query": {"type": "string", "description": "搜索查询关键词"},
"threshold": {"type": "number", "description": "相似度阈值0.0到1.0之间"},
},
"required": ["query"],
}
parameters = [
("query", "string", "搜索查询关键词", True),
("threshold", "float", "相似度阈值0.0到1.0之间", False),
]
async def execute(self, function_args: dict[str, Any]) -> dict[str, Any]:
"""执行知识库搜索

View File

@@ -14,14 +14,10 @@ class SearchKnowledgeFromLPMMTool(BaseTool):
name = "lpmm_search_knowledge"
description = "从知识库中搜索相关信息,如果你需要知识,就使用这个工具"
parameters = {
"type": "object",
"properties": {
"query": {"type": "string", "description": "搜索查询关键词"},
"threshold": {"type": "number", "description": "相似度阈值0.0到1.0之间"},
},
"required": ["query"],
}
parameters = [
("query", "string", "搜索查询关键词", True),
("threshold", "float", "相似度阈值0.0到1.0之间", False),
]
async def execute(self, function_args: Dict[str, Any]) -> Dict[str, Any]:
"""执行知识库搜索