AS AgentScopeAPI 手册 / API Reference

RequestBuilder

@FunctionalInterface public interface RequestBuilder
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:269–280

定义请求构建器契约的接口。位于 io.agentscope.core.rag.reader 包。核心成员包括 buildRequest。

Request builder functional interface. Allows users to customize how to build HTTP requests.

方法摘要Method Summary

方法Method说明Description
public Request buildRequest(String filePath, OkHttpClient httpClient) throws Exception
构建请求。
Builds HTTP request based on file path.

方法详情Method Detail

buildRequest

public Request buildRequest(String filePath, OkHttpClient httpClient) throws Exception

构建请求。

Builds HTTP request based on file path.

参数Parameters
名称Name类型Type说明Description
filePathString文件路径(类型 `String`)。File path
httpClientOkHttpClientHTTP 客户端(类型 `OkHttpClient`)。OkHttpClient instance (can be used for complex scenarios like file upload)
返回Returns Request
返回请求。Built OkHttp Request
抛出Throws
  • Exception 可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:279
基于官方固定版本源码静态生成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.