AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:302–447

构建器,用于构建并配置目标实例。位于 io.agentscope.core.rag.reader 包。核心成员包括 requestBuilder、responseParser、chunkSize、splitStrategy、overlapSize、connectTimeout。

Builder class for constructing ExternalApiReader instances.

方法摘要Method Summary

方法Method说明Description
public Builder requestBuilder(RequestBuilder requestBuilder)
设置请求构建器。
Sets the request builder.
public Builder responseParser(ResponseParser responseParser)
设置响应解析器。
Sets the response parser.
public Builder chunkSize(int chunkSize)
设置分块大小。
Sets the chunk size.
public Builder splitStrategy(SplitStrategy splitStrategy)
设置该配置项。
Sets the split strategy.
public Builder overlapSize(int overlapSize)
设置该配置项。
Sets the overlap size.
public Builder connectTimeout(Duration connectTimeout)
设置连接超时。
Sets the connection timeout.
public Builder readTimeout(Duration readTimeout)
设置读取超时。
Sets the read timeout.
public Builder writeTimeout(Duration writeTimeout)
设置写入超时。
Sets the write timeout.
public Builder maxRetries(int maxRetries)
设置最大重试。
Sets the maximum number of retries.
public Builder retryDelay(Duration retryDelay)
设置重试延迟。
Sets the retry delay.
public Builder addInterceptor(okhttp3.Interceptor interceptor)
添加拦截器。
Adds an OkHttp interceptor (for logging, authentication, etc.).
public Builder supportedFormats(List<String> formats)
设置该配置项。
Sets the supported file formats.
public Builder supportedFormats(String... formats)
设置该配置项。
Sets the supported file formats (varargs version).
public ExternalApiReader build()
构建ExternalApiReader 实例。
Builds the ExternalApiReader instance.

方法详情Method Detail

requestBuilder

public Builder requestBuilder(RequestBuilder requestBuilder)

设置请求构建器。

Sets the request builder.

参数Parameters
名称Name类型Type说明Description
requestBuilderRequestBuilder请求构建器(类型 `RequestBuilder`)。The request builder.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:319–322

responseParser

public Builder responseParser(ResponseParser responseParser)

设置响应解析器。

Sets the response parser.

参数Parameters
名称Name类型Type说明Description
responseParserResponseParser响应解析器(类型 `ResponseParser`)。The response parser.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:327–330

chunkSize

public Builder chunkSize(int chunkSize)

设置分块大小。

Sets the chunk size.

参数Parameters
名称Name类型Type说明Description
chunkSizeint分块大小(类型 `int`)。The chunk size.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:335–338

splitStrategy

public Builder splitStrategy(SplitStrategy splitStrategy)

设置该配置项。

Sets the split strategy.

参数Parameters
名称Name类型Type说明Description
splitStrategySplitStrategy已拆分 Strategy(类型 `SplitStrategy`)。The split strategy.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:343–346

overlapSize

public Builder overlapSize(int overlapSize)

设置该配置项。

Sets the overlap size.

参数Parameters
名称Name类型Type说明Description
overlapSizeintoverlap 大小(类型 `int`)。The overlap size.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:351–354

connectTimeout

public Builder connectTimeout(Duration connectTimeout)

设置连接超时。

Sets the connection timeout.

参数Parameters
名称Name类型Type说明Description
connectTimeoutDuration连接超时(类型 `Duration`)。The connect timeout.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:359–362

readTimeout

public Builder readTimeout(Duration readTimeout)

设置读取超时。

Sets the read timeout.

参数Parameters
名称Name类型Type说明Description
readTimeoutDuration读取超时(类型 `Duration`)。The read timeout.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:367–370

writeTimeout

public Builder writeTimeout(Duration writeTimeout)

设置写入超时。

Sets the write timeout.

参数Parameters
名称Name类型Type说明Description
writeTimeoutDuration写入超时(类型 `Duration`)。The write timeout.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:375–378

maxRetries

public Builder maxRetries(int maxRetries)

设置最大重试。

Sets the maximum number of retries.

参数Parameters
名称Name类型Type说明Description
maxRetriesint最大重试(类型 `int`)。The max retries.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:383–386

retryDelay

public Builder retryDelay(Duration retryDelay)

设置重试延迟。

Sets the retry delay.

参数Parameters
名称Name类型Type说明Description
retryDelayDuration重试延迟(类型 `Duration`)。The retry delay.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:391–394

addInterceptor

public Builder addInterceptor(okhttp3.Interceptor interceptor)

添加拦截器。

Adds an OkHttp interceptor (for logging, authentication, etc.).

参数Parameters
名称Name类型Type说明Description
interceptorokhttp3.Interceptor拦截器(类型 `okhttp3.Interceptor`)。The interceptor.
返回Returns Builder
返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:399–405

supportedFormats

public Builder supportedFormats(List<String> formats)

设置该配置项。

Sets the supported file formats.

参数Parameters
名称Name类型Type说明Description
formatsList<String>formats(类型 `List`)。List of supported file extensions (e.g., "pdf", "docx", "txt")
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:416–419

supportedFormats

public Builder supportedFormats(String... formats)

设置该配置项。

Sets the supported file formats (varargs version).

参数Parameters
名称Name类型Type说明Description
formats varargsString...formats(类型 `String...`)。Supported file extensions (e.g., "pdf", "docx", "txt")
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:430–433

build

public ExternalApiReader build()

构建ExternalApiReader 实例。

Builds the ExternalApiReader instance.

返回Returns ExternalApiReader
返回ExternalApiReader。Returns external api reader.
源码Source io/agentscope/core/rag/reader/ExternalApiReader.java:438–446
基于官方固定版本源码静态生成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.