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 |
|---|---|---|
role | String | 角色(类型 `String`)。the role (user or assistant) |
content | String | 消息内容。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.
String返回字符串结果。the role (user or assistant)
源码Source
io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:48–50getContent
public String getContent()
获取内容的此消息。
Gets the content of this message.
String消息内容。the message content
源码Source
io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:57–59user
public static QueryHistoryEntry user(String content)
static
创建用户消息条目。
Creates a user message entry.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
content | String | 用户's 消息。the user's message |
QueryHistoryEntry一种新的QueryHistoryEntry 使用角色"用户"。a new QueryHistoryEntry with role "user"
源码Source
io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:67–69assistant
public static QueryHistoryEntry assistant(String content)
static
设置该参数。
Creates an assistant message entry.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
content | String | 内容(类型 `String`)。the assistant's response |
QueryHistoryEntry返回QueryHistoryEntry。a new QueryHistoryEntry with role "assistant"
源码Source
io/agentscope/core/rag/integration/bailian/QueryHistoryEntry.java:77–79