类 RetrieveConfig.Builder

java.lang.Object
io.agentscope.core.rag.model.RetrieveConfig.Builder
封闭类:
RetrieveConfig

public static class RetrieveConfig.Builder extends Object
Builder for RetrieveConfig.
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • limit

      public RetrieveConfig.Builder limit(int limit)
      Sets the maximum number of documents to retrieve.
      参数:
      limit - the limit (must be positive)
      返回:
      this builder for chaining
    • scoreThreshold

      public RetrieveConfig.Builder scoreThreshold(double scoreThreshold)
      Sets the minimum similarity score threshold.
      参数:
      scoreThreshold - the score threshold (must be between 0.0 and 1.0)
      返回:
      this builder for chaining
    • vectorName

      public RetrieveConfig.Builder vectorName(String vectorName)
      Sets the vector name for retrieval.
      参数:
      vectorName - the vector name (can be null)
      返回:
      this builder for chaining
    • conversationHistory

      public RetrieveConfig.Builder conversationHistory(List<Msg> conversationHistory)
      Sets the conversation history for context-aware retrieval.

      This is an optional parameter used by knowledge bases that support multi-turn conversation context. When provided, the knowledge base may use this history to rewrite or contextualize the query for better retrieval results.

      参数:
      conversationHistory - the conversation history (can be null)
      返回:
      this builder for chaining
    • build

      public RetrieveConfig build()
      Builds the RetrieveConfig instance.
      返回:
      the configured RetrieveConfig