AS AgentScopeAPI 手册 / API Reference

WebFetchTool

public static final class WebFetchTool
源码Source io/agentscope/harness/agent/tool/WebTools.java:51–108

Web Fetch 工具,封装可被智能体调用的能力。位于 io.agentscope.harness.agent.tool 包。核心成员包括 webFetch、WebFetchTool。

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 WebFetchTool()
初始化 `WebFetchTool` 实例。
Creates a new instance.
public WebFetchTool(HttpClient client)
初始化 `WebFetchTool` 实例。
Creates a tool that uses a caller-supplied client (custom proxy, SSL, HTTP version, ...).

方法摘要Method Summary

方法Method说明Description
public String webFetch(String url, Integer maxChars)
执行 `webFetch` 方法。
Performs the web fetch operation.

构造器详情Constructor Detail

WebFetchTool

public WebFetchTool()

初始化 WebFetchTool 实例。

Creates a new instance.

源码Source io/agentscope/harness/agent/tool/WebTools.java:54–56

WebFetchTool

public WebFetchTool(HttpClient client)

初始化 WebFetchTool 实例。

Creates a tool that uses a caller-supplied client (custom proxy, SSL, HTTP version, ...).

参数Parameters
名称Name类型Type说明Description
clientHttpClient客户端(类型 `HttpClient`)。The client.
源码Source io/agentscope/harness/agent/tool/WebTools.java:59–61

方法详情Method Detail

webFetch

public String webFetch(String url, Integer maxChars)

执行 webFetch 方法。

Performs the web fetch operation.

参数Parameters
名称Name类型Type说明Description
urlString服务地址(类型 `String`)。The url.
maxCharsInteger最大字符数(类型 `Integer`)。The max chars.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/harness/agent/tool/WebTools.java:63–107
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.