AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/rag/model/RetrieveConfig.java:110–179

RetrieveConfig的构建器。位于 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
limitint数量上限(类型 `int`)。the limit (must be positive)
返回Returns Builder
返回当前实例,以支持链式调用。this builder for chaining
源码Source io/agentscope/core/rag/model/RetrieveConfig.java:123–129

scoreThreshold

public Builder scoreThreshold(double scoreThreshold)

设置分数阈值。

Sets the minimum similarity score threshold.

参数Parameters
名称Name类型Type说明Description
scoreThresholddouble分数阈值(类型 `double`)。the score threshold (must be between 0.0 and 1.0)
返回Returns Builder
返回当前实例,以支持链式调用。this builder for chaining
源码Source io/agentscope/core/rag/model/RetrieveConfig.java:137–143

vectorName

public Builder vectorName(String vectorName)

设置向量名称用于检索。

Sets the vector name for retrieval.

参数Parameters
名称Name类型Type说明Description
vectorNameString向量名称(类型 `String`)。the vector name (can be null)
返回Returns Builder
返回当前实例,以支持链式调用。this builder for chaining
源码Source io/agentscope/core/rag/model/RetrieveConfig.java:151–154

conversationHistory

public Builder conversationHistory(List<Msg> conversationHistory)

设置会话历史。

Sets the conversation history for context-aware retrieval.

参数Parameters
名称Name类型Type说明Description
conversationHistoryList<Msg>会话历史(类型 `List`)。the conversation history (can be null)
返回Returns Builder
返回当前实例,以支持链式调用。this builder for chaining
源码Source io/agentscope/core/rag/model/RetrieveConfig.java:166–169

build

public RetrieveConfig build()

构建RetrieveConfig 实例。

Builds the RetrieveConfig instance.

返回Returns RetrieveConfig
返回RetrieveConfig。the configured RetrieveConfig
源码Source io/agentscope/core/rag/model/RetrieveConfig.java:176–178
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.