AS AgentScopeAPI 手册 / API Reference

BailianMessage

@JsonInclude(JsonInclude.Include.NON_NULL) public class BailianMessage
源码Source io/agentscope/core/memory/bailian/BailianMessage.java:26–132

Bailian 消息,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.core.memory.bailian 包。核心成员包括 getRole、setRole、getContent、setContent、builder、BailianMessage。

Represents a message in the Bailian Memory API format.

Messages are used for both adding memories and searching for relevant memories. Each message has a role (user or assistant) and content.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
Builder类class
BailianMessage的构建器。
Builder for BailianMessage.

构造器摘要Constructor Summary

构造器Constructor说明Description
public BailianMessage()
初始化 `BailianMessage` 实例。
Default constructor for Jackson deserialization.
public BailianMessage(String role, String content)
初始化 `BailianMessage` 实例。
Creates a new BailianMessage with specified role and content.

方法摘要Method Summary

方法Method说明Description
public String getRole()
获取角色。
Gets the role.
public void setRole(String role)
设置角色。
Sets the role.
public String getContent()
获取内容。
Gets the content.
public void setContent(String content)
设置内容。
Sets the content.
public static Builder builder()
static
创建新的构建器用于 BailianMessage。
Creates a new builder for BailianMessage.

构造器详情Constructor Detail

BailianMessage

public BailianMessage()

初始化 BailianMessage 实例。

Default constructor for Jackson deserialization.

源码Source io/agentscope/core/memory/bailian/BailianMessage.java:36

BailianMessage

public BailianMessage(String role, String content)

初始化 BailianMessage 实例。

Creates a new BailianMessage with specified role and content.

参数Parameters
名称Name类型Type说明Description
roleString角色(类型 `String`)。the role (e.g., "user", "assistant")
contentString消息内容。the message content
源码Source io/agentscope/core/memory/bailian/BailianMessage.java:44–47

方法详情Method Detail

getRole

public String getRole()

获取角色。

Gets the role.

返回Returns String
角色。the role
源码Source io/agentscope/core/memory/bailian/BailianMessage.java:54–56

setRole

public void setRole(String role)

设置角色。

Sets the role.

参数Parameters
名称Name类型Type说明Description
roleString角色。the role
源码Source io/agentscope/core/memory/bailian/BailianMessage.java:63–65

getContent

public String getContent()

获取内容。

Gets the content.

返回Returns String
内容。the content
源码Source io/agentscope/core/memory/bailian/BailianMessage.java:72–74

setContent

public void setContent(String content)

设置内容。

Sets the content.

参数Parameters
名称Name类型Type说明Description
contentString内容。the content
源码Source io/agentscope/core/memory/bailian/BailianMessage.java:81–83

builder

public static Builder builder()
static

创建新的构建器用于 BailianMessage。

Creates a new builder for BailianMessage.

返回Returns Builder
一种新的构建器实例。a new Builder instance
源码Source io/agentscope/core/memory/bailian/BailianMessage.java:90–92

嵌套类详情Nested Class Detail

Builder

public static class Builder

BailianMessage的构建器。位于 io.agentscope.core.memory.bailian 包。核心成员包括 role、content、build。

Builder for BailianMessage.

基于官方固定版本源码静态生成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.