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 Detail
requestBuilder
public Builder requestBuilder(RequestBuilder requestBuilder)
设置请求构建器。
Sets the request builder.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
requestBuilder | RequestBuilder | 请求构建器(类型 `RequestBuilder`)。The request builder. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:319–322responseParser
public Builder responseParser(ResponseParser responseParser)
设置响应解析器。
Sets the response parser.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
responseParser | ResponseParser | 响应解析器(类型 `ResponseParser`)。The response parser. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:327–330chunkSize
public Builder chunkSize(int chunkSize)
设置分块大小。
Sets the chunk size.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
chunkSize | int | 分块大小(类型 `int`)。The chunk size. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:335–338splitStrategy
public Builder splitStrategy(SplitStrategy splitStrategy)
设置该配置项。
Sets the split strategy.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
splitStrategy | SplitStrategy | 已拆分 Strategy(类型 `SplitStrategy`)。The split strategy. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:343–346overlapSize
public Builder overlapSize(int overlapSize)
设置该配置项。
Sets the overlap size.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
overlapSize | int | overlap 大小(类型 `int`)。The overlap size. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:351–354connectTimeout
public Builder connectTimeout(Duration connectTimeout)
设置连接超时。
Sets the connection timeout.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
connectTimeout | Duration | 连接超时(类型 `Duration`)。The connect timeout. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:359–362readTimeout
public Builder readTimeout(Duration readTimeout)
设置读取超时。
Sets the read timeout.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
readTimeout | Duration | 读取超时(类型 `Duration`)。The read timeout. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:367–370writeTimeout
public Builder writeTimeout(Duration writeTimeout)
设置写入超时。
Sets the write timeout.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
writeTimeout | Duration | 写入超时(类型 `Duration`)。The write timeout. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:375–378maxRetries
public Builder maxRetries(int maxRetries)
设置最大重试。
Sets the maximum number of retries.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
maxRetries | int | 最大重试(类型 `int`)。The max retries. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:383–386retryDelay
public Builder retryDelay(Duration retryDelay)
设置重试延迟。
Sets the retry delay.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
retryDelay | Duration | 重试延迟(类型 `Duration`)。The retry delay. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:391–394addInterceptor
public Builder addInterceptor(okhttp3.Interceptor interceptor)
添加拦截器。
Adds an OkHttp interceptor (for logging, authentication, etc.).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
interceptor | okhttp3.Interceptor | 拦截器(类型 `okhttp3.Interceptor`)。The interceptor. |
Builder返回当前实例,以支持链式调用。Returns the current instance for chaining.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:399–405supportedFormats
public Builder supportedFormats(List<String> formats)
设置该配置项。
Sets the supported file formats.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
formats | List<String> | formats(类型 `List`)。List of supported file extensions (e.g., "pdf", "docx", "txt") |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:416–419supportedFormats
public Builder supportedFormats(String... formats)
设置该配置项。
Sets the supported file formats (varargs version).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
formats varargs | String... | formats(类型 `String...`)。Supported file extensions (e.g., "pdf", "docx", "txt") |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:430–433build
public ExternalApiReader build()
构建ExternalApiReader 实例。
Builds the ExternalApiReader instance.
ExternalApiReader返回ExternalApiReader。Returns external api reader.
源码Source
io/agentscope/core/rag/reader/ExternalApiReader.java:438–446