public interface ToolRetriever
| Modifier and Type | Method and Description |
|---|---|
void |
addTools(List<Tool> tools)
工具入库
|
void |
addToolsFromMetadata(List<ToolMetadata> toolMetadataList)
工具入库
|
Function<List<ConversationMessage>,String> |
getQueryPreprocessor()
获取query请求的预处理器
|
void |
remove(List<String> toolIds)
删除工具
|
List<Tool> |
search(String query)
工具检索
|
List<Tool> |
search(String query,
int topK)
工具检索
|
List<Tool> |
search(String query,
int topK,
float scoreThreshold)
工具检索
|
List<Tool> |
search(String query,
String dsl)
工具检索
|
void |
setQueryPreprocessor(Function<List<ConversationMessage>,String> preprocessor)
设置query请求的预处理器,
当ToolRetriever被设置在Agent中时,Agent在Retrieve工具前,先会调用query预处理器对多轮对话进行改写,
如果不设置,默认使用多轮中的最后一轮对话
|
void addToolsFromMetadata(List<ToolMetadata> toolMetadataList)
toolMetadataList - 需要入库的工具List<Tool> search(String query, String dsl)
query - 查询语句dsl - dslvoid setQueryPreprocessor(Function<List<ConversationMessage>,String> preprocessor)
preprocessor - query预处理器Function<List<ConversationMessage>,String> getQueryPreprocessor()
List<Tool> search(String query, int topK)
query - 查询语句topK - top k条List<Tool> search(String query, int topK, float scoreThreshold)
query - 查询语句topK - top k条scoreThreshold - 评分阈值Copyright © 2024. All rights reserved.