Class BailianKnowledge.Builder
java.lang.Object
io.agentscope.core.rag.integration.bailian.BailianKnowledge.Builder
- Enclosing class:
- BailianKnowledge
Builder for BailianKnowledge.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new BailianKnowledge instance.client(BailianClient client) Sets the Bailian client directly.config(BailianConfig config) Sets the Bailian configuration.Sets the knowledge base index ID.
-
Method Details
-
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
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
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
Builds a new BailianKnowledge instance.- Returns:
- a new BailianKnowledge instance
- Throws:
IllegalArgumentException- if required parameters are missingIllegalStateException- if both config and client are set
-