Message
public class Message extends Event
io/agentscope/runtime/engine/schemas/Message.java:28–187表示消息 in 智能体运行时。位于 io.agentscope.runtime.engine.schemas 包,继承自 Event。核心成员包括 getId、setId、getObject、setObject、getType、setType。
Represents a message in the agent runtime.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public Message() | 初始化 `Message` 实例。 Creates a new instance. |
public Message(String type, String role) | 初始化 `Message` 实例。 Creates a new instance. |
方法摘要Method Summary
构造器详情Constructor Detail
Message
public Message()
初始化 Message 实例。
Creates a new instance.
io/agentscope/runtime/engine/schemas/Message.java:56–60Message
public Message(String type, String role)
初始化 Message 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
type | String | 类型(类型 `String`)。The type. |
role | String | 角色(类型 `String`)。The role. |
io/agentscope/runtime/engine/schemas/Message.java:62–66方法详情Method Detail
getId
public String getId()
获取标识。
Returns the id.
Stringio/agentscope/runtime/engine/schemas/Message.java:69–71setId
public void setId(String id)
设置标识。
Sets the id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
io/agentscope/runtime/engine/schemas/Message.java:73–75getObject
public String getObject()
获取对象。
Returns the object.
Stringio/agentscope/runtime/engine/schemas/Message.java:77–79setObject
public void setObject(String object)
设置对象。
Sets the object.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
object | String | 对象(类型 `String`)。The object. |
io/agentscope/runtime/engine/schemas/Message.java:81–83getType
public String getType()
获取类型。
Returns the type.
Stringio/agentscope/runtime/engine/schemas/Message.java:85–87setType
public void setType(String type)
设置类型。
Sets the type.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
type | String | 类型(类型 `String`)。The type. |
io/agentscope/runtime/engine/schemas/Message.java:89–91getRole
public String getRole()
获取角色。
Returns the role.
Stringio/agentscope/runtime/engine/schemas/Message.java:93–95setRole
public void setRole(String role)
设置角色。
Sets the role.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
role | String | 角色(类型 `String`)。The role. |
io/agentscope/runtime/engine/schemas/Message.java:97–99getContent
public List<Content> getContent()
获取内容。
Returns the content.
List<Content>io/agentscope/runtime/engine/schemas/Message.java:101–103setContent
public void setContent(List<Content> content)
设置内容。
Sets the content.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
content | List<Content> | 内容(类型 `List`)。The content. |
io/agentscope/runtime/engine/schemas/Message.java:105–107getCode
public String getCode()
获取 getCode。
Returns the code.
Stringio/agentscope/runtime/engine/schemas/Message.java:109–111setCode
public void setCode(String code)
设置 setCode。
Sets the code.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
code | String | code(类型 `String`)。The code. |
io/agentscope/runtime/engine/schemas/Message.java:113–115getMessage
public String getMessage()
获取消息。
Returns the message.
Stringio/agentscope/runtime/engine/schemas/Message.java:117–119setMessage
public void setMessage(String message)
设置消息。
Sets the message.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 消息(类型 `String`)。The message. |
io/agentscope/runtime/engine/schemas/Message.java:121–123getUsage
public Map<String, Object> getUsage()
获取用量。
Returns the usage.
Map<String, Object>io/agentscope/runtime/engine/schemas/Message.java:125–127setUsage
public void setUsage(Map<String, Object> usage)
设置用量。
Sets the usage.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
usage | Map<String, Object> | 用量(类型 `Map`)。The usage. |
io/agentscope/runtime/engine/schemas/Message.java:129–131getMetadata
public Map<String, Object> getMetadata()
获取元数据。
Returns the metadata.
Map<String, Object>io/agentscope/runtime/engine/schemas/Message.java:133–135setMetadata
public void setMetadata(Map<String, Object> metadata)
设置元数据。
Sets the metadata.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
metadata | Map<String, Object> | 元数据(类型 `Map`)。The metadata. |
io/agentscope/runtime/engine/schemas/Message.java:137–139addDeltaContent
public Content addDeltaContent(Content newContent)
添加增量内容。
Adds delta content to the message.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
newContent | Content | 新建内容(类型 `Content`)。The new content. |
Contentio/agentscope/runtime/engine/schemas/Message.java:144–170inProgress
public Message inProgress()
将响应状态设置为进行中。
Marks the message as in progress.
Messageio/agentscope/runtime/engine/schemas/Message.java:175–178completed
public Message completed()
返回已完成。
Marks the message as completed.
Messageio/agentscope/runtime/engine/schemas/Message.java:183–186