AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/rag/knowledge/SimpleKnowledge.java:221–264

SimpleKnowledge的构建器。位于 io.agentscope.core.rag.knowledge 包。核心成员包括 embeddingModel、embeddingStore、build。

Builder for SimpleKnowledge.

方法摘要Method Summary

方法Method说明Description
public Builder embeddingModel(EmbeddingModel embeddingModel)
设置向量化模型。
Sets the embedding model.
public Builder embeddingStore(VDBStoreBase embeddingStore)
设置向量化存储(向量数据库)。
Sets the embedding store (vector database).
public SimpleKnowledge build()
构建新的SimpleKnowledge 实例。
Builds a new SimpleKnowledge instance.

方法详情Method Detail

embeddingModel

public Builder embeddingModel(EmbeddingModel embeddingModel)

设置向量化模型。

Sets the embedding model.

参数Parameters
名称Name类型Type说明Description
embeddingModelEmbeddingModel向量化模型到使用。the embedding model to use
返回Returns Builder
返回当前实例,以支持链式调用。this builder for method chaining
源码Source io/agentscope/core/rag/knowledge/SimpleKnowledge.java:233–236

embeddingStore

public Builder embeddingStore(VDBStoreBase embeddingStore)

设置向量化存储(向量数据库)。

Sets the embedding store (vector database).

参数Parameters
名称Name类型Type说明Description
embeddingStoreVDBStoreBase向量存储到使用。the vector store to use
返回Returns Builder
返回当前实例,以支持链式调用。this builder for method chaining
源码Source io/agentscope/core/rag/knowledge/SimpleKnowledge.java:244–247

build

public SimpleKnowledge build()

构建新的SimpleKnowledge 实例。

Builds a new SimpleKnowledge instance.

返回Returns SimpleKnowledge
一种新的SimpleKnowledge 实例。a new SimpleKnowledge instance
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if required parameters are missing
源码Source io/agentscope/core/rag/knowledge/SimpleKnowledge.java:255–263
基于官方固定版本源码静态生成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.