BaseResponse
public class BaseResponse extends Event
io/agentscope/runtime/engine/schemas/BaseResponse.java:28–149基类响应,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.engine.schemas 包,继承自 Event。核心成员包括 getId、setId、getObject、setObject、getCreatedAt、setCreatedAt。
Base response class for agent responses. Extends Event to include response-specific fields.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public BaseResponse() | 初始化 `BaseResponse` 实例。 Creates a new instance. |
public BaseResponse(String id) | 初始化 `BaseResponse` 实例。 Creates a new instance. |
方法摘要Method Summary
构造器详情Constructor Detail
BaseResponse
public BaseResponse()
初始化 BaseResponse 实例。
Creates a new instance.
io/agentscope/runtime/engine/schemas/BaseResponse.java:47–51BaseResponse
public BaseResponse(String id)
初始化 BaseResponse 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
io/agentscope/runtime/engine/schemas/BaseResponse.java:53–57方法详情Method Detail
getId
public String getId()
获取标识。
Returns the id.
Stringio/agentscope/runtime/engine/schemas/BaseResponse.java:59–61setId
public void setId(String id)
设置标识。
Sets the id.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
io/agentscope/runtime/engine/schemas/BaseResponse.java:63–65getObject
public String getObject()
获取对象。
Returns the object.
Stringio/agentscope/runtime/engine/schemas/BaseResponse.java:67–69setObject
public void setObject(String object)
设置对象。
Sets the object.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
object | String | 对象(类型 `String`)。The object. |
io/agentscope/runtime/engine/schemas/BaseResponse.java:71–73getCreatedAt
public Long getCreatedAt()
获取已创建 At。
Returns the created at.
Longio/agentscope/runtime/engine/schemas/BaseResponse.java:75–77setCreatedAt
public void setCreatedAt(Long createdAt)
设置已创建 At。
Sets the created at.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
createdAt | Long | 已创建 At(类型 `Long`)。The created at. |
io/agentscope/runtime/engine/schemas/BaseResponse.java:79–81getCompletedAt
public Long getCompletedAt()
获取已完成 At。
Returns the completed at.
Longio/agentscope/runtime/engine/schemas/BaseResponse.java:83–85setCompletedAt
public void setCompletedAt(Long completedAt)
设置已完成 At。
Sets the completed at.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
completedAt | Long | 已完成 At(类型 `Long`)。The completed at. |
io/agentscope/runtime/engine/schemas/BaseResponse.java:87–89getOutput
public List<Message> getOutput()
获取输出。
Returns the output.
List<Message>io/agentscope/runtime/engine/schemas/BaseResponse.java:91–93setOutput
public void setOutput(List<Message> output)
设置输出。
Sets the output.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
output | List<Message> | 输出(类型 `List`)。The output. |
io/agentscope/runtime/engine/schemas/BaseResponse.java:95–97getUsage
public Map<String, Object> getUsage()
获取用量。
Returns the usage.
Map<String, Object>io/agentscope/runtime/engine/schemas/BaseResponse.java:99–101setUsage
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/BaseResponse.java:103–105addNewMessage
public void addNewMessage(Message message)
添加新建消息。
Add a new message to the output list.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | Message | 消息(类型 `Message`)。The message. |
io/agentscope/runtime/engine/schemas/BaseResponse.java:110–115created
public BaseResponse created()
返回已创建。
Set status to created and return self.
BaseResponseio/agentscope/runtime/engine/schemas/BaseResponse.java:120–123inProgress
public BaseResponse inProgress()
将响应状态设置为进行中。
Set status to in_progress and return self.
BaseResponseio/agentscope/runtime/engine/schemas/BaseResponse.java:128–131completed
public BaseResponse completed()
返回已完成。
Set status to completed and return self.
BaseResponseio/agentscope/runtime/engine/schemas/BaseResponse.java:136–140failed
public BaseResponse failed(Error error)
设置失败。
Set status to failed with error and return self.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
error | Error | 错误(类型 `Error`)。The error. |
BaseResponseio/agentscope/runtime/engine/schemas/BaseResponse.java:145–148