Builder
public static class Builder
源码Source
io/agentscope/core/rag/model/RetrieveConfig.java:110–179RetrieveConfig的构建器。位于 io.agentscope.core.rag.model 包。核心成员包括 limit、scoreThreshold、vectorName、conversationHistory、build。
Builder for RetrieveConfig.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder limit(int limit) | 设置限制。 Sets the maximum number of documents to retrieve. |
public Builder scoreThreshold(double scoreThreshold) | 设置分数阈值。 Sets the minimum similarity score threshold. |
public Builder vectorName(String vectorName) | 设置向量名称用于检索。 Sets the vector name for retrieval. |
public Builder conversationHistory(List<Msg> conversationHistory) | 设置会话历史。 Sets the conversation history for context-aware retrieval. |
public RetrieveConfig build() | 构建RetrieveConfig 实例。 Builds the RetrieveConfig instance. |
方法详情Method Detail
limit
public Builder limit(int limit)
设置限制。
Sets the maximum number of documents to retrieve.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
limit | int | 数量上限(类型 `int`)。the limit (must be positive) |
Builder返回当前实例,以支持链式调用。this builder for chaining
源码Source
io/agentscope/core/rag/model/RetrieveConfig.java:123–129scoreThreshold
public Builder scoreThreshold(double scoreThreshold)
设置分数阈值。
Sets the minimum similarity score threshold.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
scoreThreshold | double | 分数阈值(类型 `double`)。the score threshold (must be between 0.0 and 1.0) |
Builder返回当前实例,以支持链式调用。this builder for chaining
源码Source
io/agentscope/core/rag/model/RetrieveConfig.java:137–143vectorName
public Builder vectorName(String vectorName)
设置向量名称用于检索。
Sets the vector name for retrieval.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
vectorName | String | 向量名称(类型 `String`)。the vector name (can be null) |
Builder返回当前实例,以支持链式调用。this builder for chaining
源码Source
io/agentscope/core/rag/model/RetrieveConfig.java:151–154conversationHistory
public Builder conversationHistory(List<Msg> conversationHistory)
设置会话历史。
Sets the conversation history for context-aware retrieval.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
conversationHistory | List<Msg> | 会话历史(类型 `List`)。the conversation history (can be null) |
Builder返回当前实例,以支持链式调用。this builder for chaining
源码Source
io/agentscope/core/rag/model/RetrieveConfig.java:166–169build
public RetrieveConfig build()
构建RetrieveConfig 实例。
Builds the RetrieveConfig instance.
RetrieveConfig返回RetrieveConfig。the configured RetrieveConfig
源码Source
io/agentscope/core/rag/model/RetrieveConfig.java:176–178