Class BailianKnowledge.Builder

java.lang.Object
io.agentscope.core.rag.integration.bailian.BailianKnowledge.Builder
Enclosing class:
BailianKnowledge

public static class BailianKnowledge.Builder extends Object
Builder for BailianKnowledge.
  • Method Details

    • config

      public BailianKnowledge.Builder config(BailianConfig config)
      Sets the Bailian configuration.

      If this is set, a BailianClient will be automatically created from the config. You cannot set both config and client - choose one approach.

      Parameters:
      config - the Bailian configuration
      Returns:
      this builder for method chaining
    • client

      public BailianKnowledge.Builder client(BailianClient client)
      Sets the Bailian client directly.

      Use this if you want to share a client instance across multiple BailianKnowledge instances. You cannot set both config and client.

      Parameters:
      client - the Bailian client
      Returns:
      this builder for method chaining
    • indexId

      public BailianKnowledge.Builder indexId(String indexId)
      Sets the knowledge base index ID.

      This overrides the indexId from config if both are provided.

      Parameters:
      indexId - the knowledge base index ID
      Returns:
      this builder for method chaining
    • build

      public BailianKnowledge build()
      Builds a new BailianKnowledge instance.
      Returns:
      a new BailianKnowledge instance
      Throws:
      IllegalArgumentException - if required parameters are missing
      IllegalStateException - if both config and client are set