Class DifyKnowledge.Builder

java.lang.Object
io.agentscope.core.rag.integration.dify.DifyKnowledge.Builder
Enclosing class:
DifyKnowledge

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

    • config

      public DifyKnowledge.Builder config(DifyRAGConfig config)
      Sets the Dify configuration.

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

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

      public DifyKnowledge.Builder client(DifyRAGClient client)
      Sets the Dify client directly.

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

      Parameters:
      client - the Dify client
      Returns:
      this builder for method chaining
    • build

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