AS AgentScopeAPI 手册 / API Reference

QueryHistoryEntry

public class QueryHistoryEntry
源码Source io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:24–80

查询历史条目,把私有文档转化为可检索的知识。位于 io.agentscope.core.rag.integration.bailian 包。核心成员包括 getRole、getContent、user、assistant、QueryHistoryEntry。

Query history entry for multi-turn conversation rewrite.

This class represents a single message in the conversation history, used for multi-turn dialogue rewriting to improve retrieval effectiveness.

构造器摘要Constructor Summary

构造器Constructor说明Description
public QueryHistoryEntry(String role, String content)
创建新的QueryHistoryEntry。
Creates a new QueryHistoryEntry.

方法摘要Method Summary

方法Method说明Description
public String getRole()
获取角色的此消息。
Gets the role of this message.
public String getContent()
获取内容的此消息。
Gets the content of this message.
public static QueryHistoryEntry user(String content)
static
创建用户消息条目。
Creates a user message entry.
public static QueryHistoryEntry assistant(String content)
static
设置该参数。
Creates an assistant message entry.

构造器详情Constructor Detail

QueryHistoryEntry

public QueryHistoryEntry(String role, String content)

创建新的QueryHistoryEntry。

Creates a new QueryHistoryEntry.

参数Parameters
名称Name类型Type说明Description
roleString角色(类型 `String`)。the role (user or assistant)
contentString消息内容。the message content
源码Source io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:35–41

方法详情Method Detail

getRole

public String getRole()

获取角色的此消息。

Gets the role of this message.

返回Returns String
返回字符串结果。the role (user or assistant)
源码Source io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:48–50

getContent

public String getContent()

获取内容的此消息。

Gets the content of this message.

返回Returns String
消息内容。the message content
源码Source io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:57–59

user

public static QueryHistoryEntry user(String content)
static

创建用户消息条目。

Creates a user message entry.

参数Parameters
名称Name类型Type说明Description
contentString用户's 消息。the user's message
返回Returns QueryHistoryEntry
一种新的QueryHistoryEntry 使用角色"用户"。a new QueryHistoryEntry with role "user"
源码Source io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:67–69

assistant

public static QueryHistoryEntry assistant(String content)
static

设置该参数。

Creates an assistant message entry.

参数Parameters
名称Name类型Type说明Description
contentString内容(类型 `String`)。the assistant's response
返回Returns QueryHistoryEntry
返回QueryHistoryEntry。a new QueryHistoryEntry with role "assistant"
源码Source io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:77–79
基于官方固定版本源码静态生成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.