Class BailianConfig
java.lang.Object
io.agentscope.core.rag.integration.bailian.BailianConfig
Configuration for Alibaba Cloud Bailian Knowledge Base.
This class contains all the necessary configuration parameters to connect to and interact with Alibaba Cloud Bailian Knowledge Base service, including connection settings and retrieval parameters.
Example usage:
BailianConfig config = BailianConfig.builder()
.accessKeyId(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"))
.accessKeySecret(System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"))
.workspaceId("llm-xxx")
.indexId("mymxbdxxxx")
// Optional: configure retrieval parameters
.denseSimilarityTopK(50)
.sparseSimilarityTopK(50)
.enableReranking(true)
.rerankConfig(RerankConfig.builder()
.modelName("gte-rerank-hybrid")
.build())
.enableRewrite(true)
.rewriteConfig(RewriteConfig.builder()
.modelName("conv-rewrite-qwen-1.8b")
.build())
.build();
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic BailianConfig.Builderbuilder()Creates a new builder for BailianConfig.Gets the Alibaba Cloud Access Key ID.Gets the Alibaba Cloud Access Key Secret.Gets the dense similarity top K value.Checks if reranking is enabled.Checks if query rewrite is enabled.Gets the Bailian API endpoint.Gets the knowledge base index ID.Gets the rerank configuration.Gets the rewrite configuration.Checks if retriever history should be saved.Gets the search filters.Gets the sparse similarity top K value.Gets the Bailian workspace ID.
-
Method Details
-
getAccessKeyId
Gets the Alibaba Cloud Access Key ID.- Returns:
- the access key ID
-
getAccessKeySecret
Gets the Alibaba Cloud Access Key Secret.- Returns:
- the access key secret
-
getWorkspaceId
Gets the Bailian workspace ID.- Returns:
- the workspace ID
-
getIndexId
Gets the knowledge base index ID.- Returns:
- the index ID, or null if not set
-
getEndpoint
Gets the Bailian API endpoint.- Returns:
- the API endpoint
-
getDenseSimilarityTopK
Gets the dense similarity top K value.- Returns:
- the dense similarity top K (0-100), or null if not set
-
getSparseSimilarityTopK
Gets the sparse similarity top K value.- Returns:
- the sparse similarity top K (0-100), or null if not set
-
getEnableReranking
Checks if reranking is enabled.- Returns:
- true if reranking is enabled, null if not configured
-
getRerankConfig
Gets the rerank configuration.- Returns:
- the rerank config, or null if not set
-
getEnableRewrite
Checks if query rewrite is enabled.- Returns:
- true if rewrite is enabled, null if not configured
-
getRewriteConfig
Gets the rewrite configuration.- Returns:
- the rewrite config, or null if not set
-
getSearchFilters
Gets the search filters.- Returns:
- the search filters list, or null if not set
-
getSaveRetrieverHistory
Checks if retriever history should be saved.- Returns:
- true if history should be saved, null if not configured
-
builder
Creates a new builder for BailianConfig.- Returns:
- a new Builder instance
-