Class BailianConfig.Builder
java.lang.Object
io.agentscope.core.rag.integration.bailian.BailianConfig.Builder
- Enclosing class:
- BailianConfig
Builder for BailianConfig.
-
Method Summary
Modifier and TypeMethodDescriptionaccessKeyId(String accessKeyId) Sets the Alibaba Cloud Access Key ID.accessKeySecret(String accessKeySecret) Sets the Alibaba Cloud Access Key Secret.build()Builds a new BailianConfig instance.denseSimilarityTopK(Integer denseSimilarityTopK) Sets the dense similarity top K.enableReranking(Boolean enableReranking) Sets whether to enable reranking.enableRewrite(Boolean enableRewrite) Sets whether to enable multi-turn conversation rewrite.Sets the Bailian API endpoint.Sets the knowledge base index ID.rerankConfig(RerankConfig rerankConfig) Sets the rerank configuration.rewriteConfig(RewriteConfig rewriteConfig) Sets the rewrite configuration.saveRetrieverHistory(Boolean saveRetrieverHistory) Sets whether to save retriever history.searchFilters(List<Map<String, String>> searchFilters) Sets search filters for personalized retrieval.sparseSimilarityTopK(Integer sparseSimilarityTopK) Sets the sparse similarity top K.workspaceId(String workspaceId) Sets the Bailian workspace ID.
-
Method Details
-
accessKeyId
Sets the Alibaba Cloud Access Key ID.- Parameters:
accessKeyId- the access key ID- Returns:
- this builder for method chaining
-
accessKeySecret
Sets the Alibaba Cloud Access Key Secret.- Parameters:
accessKeySecret- the access key secret- Returns:
- this builder for method chaining
-
workspaceId
Sets the Bailian workspace ID.- Parameters:
workspaceId- the workspace ID- Returns:
- this builder for method chaining
-
indexId
Sets the knowledge base index ID.This is optional for configuration, but required when calling retrieve().
- Parameters:
indexId- the index ID- Returns:
- this builder for method chaining
-
endpoint
Sets the Bailian API endpoint.If not set, defaults to "bailian.cn-beijing.aliyuncs.com".
Available endpoints:
- Public Cloud: bailian.cn-beijing.aliyuncs.com
- Finance Cloud: bailian.cn-shanghai-finance-1.aliyuncs.com
- VPC (Beijing): bailian-vpc.cn-beijing.aliyuncs.com
- VPC (Shanghai Finance): bailian-vpc.cn-shanghai-finance-1.aliyuncs.com
- Parameters:
endpoint- the API endpoint- Returns:
- this builder for method chaining
-
denseSimilarityTopK
Sets the dense similarity top K.Vector retrieval top K. Range: [0-100], default: 100. Note: denseSimilarityTopK + sparseSimilarityTopK must be smaller than 200.
- Parameters:
denseSimilarityTopK- the top K value- Returns:
- this builder
-
sparseSimilarityTopK
Sets the sparse similarity top K.Keyword retrieval top K. Range: [0-100], default: 100. Note: denseSimilarityTopK + sparseSimilarityTopK must be smaller than 200.
- Parameters:
sparseSimilarityTopK- the top K value- Returns:
- this builder
-
enableReranking
Sets whether to enable reranking.Default: true (enabled)
- Parameters:
enableReranking- true to enable reranking- Returns:
- this builder
-
rerankConfig
Sets the rerank configuration.- Parameters:
rerankConfig- the rerank config- Returns:
- this builder
-
enableRewrite
Sets whether to enable multi-turn conversation rewrite.Default: false (disabled)
- Parameters:
enableRewrite- true to enable rewrite- Returns:
- this builder
-
rewriteConfig
Sets the rewrite configuration.- Parameters:
rewriteConfig- the rewrite config- Returns:
- this builder
-
searchFilters
Sets search filters for personalized retrieval.Filters can be used to exclude irrelevant information based on tags and other metadata.
- Parameters:
searchFilters- the search filters- Returns:
- this builder
-
saveRetrieverHistory
Sets whether to save retriever history.Default: false
- Parameters:
saveRetrieverHistory- true to save history- Returns:
- this builder
-
build
Builds a new BailianConfig instance.- Returns:
- a new BailianConfig instance
- Throws:
IllegalArgumentException- if required parameters are missing
-