Class DifyKnowledge.Builder
java.lang.Object
io.agentscope.core.rag.integration.dify.DifyKnowledge.Builder
- Enclosing class:
- DifyKnowledge
Builder for DifyKnowledge.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new DifyKnowledge instance.client(DifyRAGClient client) Sets the Dify client directly.config(DifyRAGConfig config) Sets the Dify configuration.
-
Method Details
-
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
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
Builds a new DifyKnowledge instance.- Returns:
- a new DifyKnowledge instance
- Throws:
IllegalArgumentException- if required parameters are missingIllegalStateException- if both config and client are set
-