Class BailianConfig

java.lang.Object
io.agentscope.core.rag.integration.bailian.BailianConfig

public class BailianConfig extends Object
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();
 
  • Method Details

    • getAccessKeyId

      public String getAccessKeyId()
      Gets the Alibaba Cloud Access Key ID.
      Returns:
      the access key ID
    • getAccessKeySecret

      public String getAccessKeySecret()
      Gets the Alibaba Cloud Access Key Secret.
      Returns:
      the access key secret
    • getWorkspaceId

      public String getWorkspaceId()
      Gets the Bailian workspace ID.
      Returns:
      the workspace ID
    • getIndexId

      public String getIndexId()
      Gets the knowledge base index ID.
      Returns:
      the index ID, or null if not set
    • getEndpoint

      public String getEndpoint()
      Gets the Bailian API endpoint.
      Returns:
      the API endpoint
    • getDenseSimilarityTopK

      public Integer getDenseSimilarityTopK()
      Gets the dense similarity top K value.
      Returns:
      the dense similarity top K (0-100), or null if not set
    • getSparseSimilarityTopK

      public Integer getSparseSimilarityTopK()
      Gets the sparse similarity top K value.
      Returns:
      the sparse similarity top K (0-100), or null if not set
    • getEnableReranking

      public Boolean getEnableReranking()
      Checks if reranking is enabled.
      Returns:
      true if reranking is enabled, null if not configured
    • getRerankConfig

      public RerankConfig getRerankConfig()
      Gets the rerank configuration.
      Returns:
      the rerank config, or null if not set
    • getEnableRewrite

      public Boolean getEnableRewrite()
      Checks if query rewrite is enabled.
      Returns:
      true if rewrite is enabled, null if not configured
    • getRewriteConfig

      public RewriteConfig getRewriteConfig()
      Gets the rewrite configuration.
      Returns:
      the rewrite config, or null if not set
    • getSearchFilters

      public List<Map<String,String>> getSearchFilters()
      Gets the search filters.
      Returns:
      the search filters list, or null if not set
    • getSaveRetrieverHistory

      public Boolean getSaveRetrieverHistory()
      Checks if retriever history should be saved.
      Returns:
      true if history should be saved, null if not configured
    • builder

      public static BailianConfig.Builder builder()
      Creates a new builder for BailianConfig.
      Returns:
      a new Builder instance