WebSearchTool
public static final class WebSearchTool
源码Source
io/agentscope/harness/agent/tool/WebTools.java:110–192Web 搜索工具,封装可被智能体调用的能力。位于 io.agentscope.harness.agent.tool 包。核心成员包括 webSearch、WebSearchTool。
A class in io.agentscope.harness.agent.tool that lets agents invoke external capabilities under control. Declared in io.agentscope.harness.agent.tool.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public WebSearchTool() | 初始化 `WebSearchTool` 实例。 Creates a new instance. |
public WebSearchTool(HttpClient client) | 初始化 `WebSearchTool` 实例。 Creates a tool that uses a caller-supplied client (custom proxy, SSL, HTTP version, ...). |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String webSearch(String query, Integer maxResults) | 执行 `webSearch` 方法。 Performs the web search operation. |
构造器详情Constructor Detail
WebSearchTool
public WebSearchTool()
初始化 WebSearchTool 实例。
Creates a new instance.
源码Source
io/agentscope/harness/agent/tool/WebTools.java:115–117WebSearchTool
public WebSearchTool(HttpClient client)
初始化 WebSearchTool 实例。
Creates a tool that uses a caller-supplied client (custom proxy, SSL, HTTP version, ...).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
client | HttpClient | 客户端(类型 `HttpClient`)。The client. |
源码Source
io/agentscope/harness/agent/tool/WebTools.java:120–122方法详情Method Detail
webSearch
public String webSearch(String query, Integer maxResults)
执行 webSearch 方法。
Performs the web search operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
query | String | 查询文本(类型 `String`)。The query. |
maxResults | Integer | 最大结果(类型 `Integer`)。The max results. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/tool/WebTools.java:124–191