tools系统
This commit is contained in:
@@ -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]:
|
||||
"""执行知识库搜索
|
||||
|
||||
@@ -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]:
|
||||
"""执行知识库搜索
|
||||
|
||||
Reference in New Issue
Block a user