AS AgentScopeAPI 手册 / API Reference

HayStackDocument

@JsonIgnoreProperties(ignoreUnknown = true) public class HayStackDocument
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:23–126

Hay Stack 文档,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.core.rag.integration.haystack.model 包。核心成员包括 getId、setId、getContent、setContent、getBlob、setBlob。

A class in io.agentscope.core.rag.integration.haystack.model that talks to model services and returns generated or embedded output. Declared in io.agentscope.core.rag.integration.haystack.model.

方法摘要Method Summary

方法Method说明Description
public String getId()
获取标识。
Returns the id.
public void setId(String id)
设置标识。
Sets the id.
public String getContent()
获取内容。
Returns the content.
public void setContent(String content)
设置内容。
Sets the content.
public ByteStream getBlob()
获取二进制对象。
Returns the blob.
public void setBlob(ByteStream blob)
设置二进制对象。
Sets the blob.
public Map<String, Object> getMeta()
获取元数据。
Returns the meta.
public void setMeta(Map<String, Object> meta)
设置元数据。
Sets the meta.
public Double getScore()
获取分数。
Returns the score.
public void setScore(Double score)
设置分数。
Sets the score.
public List<Double> getEmbedding()
获取向量化。
Returns the embedding.
public void setEmbedding(List<Double> embedding)
设置向量化。
Sets the embedding.
public SparseEmbedding getSparseEmbedding()
获取 `getSparseEmbedding`。
Returns the sparse embedding.
public void setSparseEmbedding(SparseEmbedding sparseEmbedding)
设置 `setSparseEmbedding`。
Sets the sparse embedding.
public String toString()
返回 `toString` 结果。
Returns the to string.

方法详情Method Detail

getId

public String getId()

获取标识。

Returns the id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:49–51

setId

public void setId(String id)

设置标识。

Sets the id.

参数Parameters
名称Name类型Type说明Description
idString标识(类型 `String`)。The id.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:53–55

getContent

public String getContent()

获取内容。

Returns the content.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:57–59

setContent

public void setContent(String content)

设置内容。

Sets the content.

参数Parameters
名称Name类型Type说明Description
contentString内容(类型 `String`)。The content.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:61–63

getBlob

public ByteStream getBlob()

获取二进制对象。

Returns the blob.

返回Returns ByteStream
返回ByteStream。Returns byte stream.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:65–67

setBlob

public void setBlob(ByteStream blob)

设置二进制对象。

Sets the blob.

参数Parameters
名称Name类型Type说明Description
blobByteStream二进制对象(类型 `ByteStream`)。The blob.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:69–71

getMeta

public Map<String, Object> getMeta()

获取元数据。

Returns the meta.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:73–75

setMeta

public void setMeta(Map<String, Object> meta)

设置元数据。

Sets the meta.

参数Parameters
名称Name类型Type说明Description
metaMap<String, Object>元数据(类型 `Map`)。The meta.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:77–79

getScore

public Double getScore()

获取分数。

Returns the score.

返回Returns Double
返回数值结果。Returns a numeric result.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:81–83

setScore

public void setScore(Double score)

设置分数。

Sets the score.

参数Parameters
名称Name类型Type说明Description
scoreDouble分数(类型 `Double`)。The score.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:85–87

getEmbedding

public List<Double> getEmbedding()

获取向量化。

Returns the embedding.

返回Returns List<Double>
返回列出。Returns list.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:89–91

setEmbedding

public void setEmbedding(List<Double> embedding)

设置向量化。

Sets the embedding.

参数Parameters
名称Name类型Type说明Description
embeddingList<Double>向量(类型 `List`)。The embedding.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:93–95

getSparseEmbedding

public SparseEmbedding getSparseEmbedding()

获取 getSparseEmbedding。

Returns the sparse embedding.

返回Returns SparseEmbedding
返回SparseEmbedding。Returns sparse embedding.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:97–99

setSparseEmbedding

public void setSparseEmbedding(SparseEmbedding sparseEmbedding)

设置 setSparseEmbedding。

Sets the sparse embedding.

参数Parameters
名称Name类型Type说明Description
sparseEmbeddingSparseEmbeddingsparse 向量化(类型 `SparseEmbedding`)。The sparse embedding.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:101–103

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/rag/integration/haystack/model/HayStackDocument.java:105–125
基于官方固定版本源码静态生成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.