Package io.agentscope.core.rag.reader
Class ExternalApiReader.Builder
java.lang.Object
io.agentscope.core.rag.reader.ExternalApiReader.Builder
- Enclosing class:
- ExternalApiReader
Builder class for constructing ExternalApiReader instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddInterceptor(okhttp3.Interceptor interceptor) Adds an OkHttp interceptor (for logging, authentication, etc.).build()Builds the ExternalApiReader instance.chunkSize(int chunkSize) Sets the chunk size.connectTimeout(Duration connectTimeout) Sets the connection timeout.maxRetries(int maxRetries) Sets the maximum number of retries.overlapSize(int overlapSize) Sets the overlap size.readTimeout(Duration readTimeout) Sets the read timeout.requestBuilder(ExternalApiReader.RequestBuilder requestBuilder) Sets the request builder.responseParser(ExternalApiReader.ResponseParser responseParser) Sets the response parser.retryDelay(Duration retryDelay) Sets the retry delay.splitStrategy(SplitStrategy splitStrategy) Sets the split strategy.supportedFormats(String... formats) Sets the supported file formats (varargs version).supportedFormats(List<String> formats) Sets the supported file formats.writeTimeout(Duration writeTimeout) Sets the write timeout.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
requestBuilder
Sets the request builder. -
responseParser
Sets the response parser. -
chunkSize
Sets the chunk size. -
splitStrategy
Sets the split strategy. -
overlapSize
Sets the overlap size. -
connectTimeout
Sets the connection timeout. -
readTimeout
Sets the read timeout. -
writeTimeout
Sets the write timeout. -
maxRetries
Sets the maximum number of retries. -
retryDelay
Sets the retry delay. -
addInterceptor
Adds an OkHttp interceptor (for logging, authentication, etc.). -
supportedFormats
Sets the supported file formats.If not set or empty, the reader will attempt to process any file format, relying on the external API to handle format validation.
- Parameters:
formats- List of supported file extensions (e.g., "pdf", "docx", "txt")- Returns:
- this builder
-
supportedFormats
Sets the supported file formats (varargs version).If not set or empty, the reader will attempt to process any file format, relying on the external API to handle format validation.
- Parameters:
formats- Supported file extensions (e.g., "pdf", "docx", "txt")- Returns:
- this builder
-
build
Builds the ExternalApiReader instance.
-