AgentResponse
public class AgentResponse extends BaseResponse
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:25–91智能体响应,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.engine.schemas 包,继承自 BaseResponse。核心成员包括 getSessionId、setSessionId、created、inProgress、completed、failed。
Agent response class that extends BaseResponse. Includes session_id for conversation tracking.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public AgentResponse() | 初始化 `AgentResponse` 实例。 Creates a new instance. |
public AgentResponse(String id) | 初始化 `AgentResponse` 实例。 Creates a new instance. |
public AgentResponse(String id, String sessionId) | 初始化 `AgentResponse` 实例。 Creates a new instance. |
public AgentResponse(String id, String sessionId, Long createdAt) | 初始化 `AgentResponse` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getSessionId() | 获取会话标识。 Returns the session id. |
public void setSessionId(String sessionId) | 设置会话标识。 Sets the session id. |
public AgentResponse created() | 返回已创建。 Set status to created and return self. |
public AgentResponse inProgress() | 将响应状态设置为进行中。 Set status to in_progress and return self. |
public AgentResponse completed() | 返回已完成。 Set status to completed and return self. |
public AgentResponse failed(Error error) | 设置失败。 Set status to failed with error and return self. |
构造器详情Constructor Detail
AgentResponse
public AgentResponse()
初始化 AgentResponse 实例。
Creates a new instance.
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:29–31AgentResponse
public AgentResponse(String id)
初始化 AgentResponse 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:33–35AgentResponse
public AgentResponse(String id, String sessionId)
初始化 AgentResponse 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:37–40AgentResponse
public AgentResponse(String id, String sessionId, Long createdAt)
初始化 AgentResponse 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
sessionId | String | 会话标识(类型 `String`)。The session id. |
createdAt | Long | 已创建 At(类型 `Long`)。The created at. |
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:42–46方法详情Method Detail
getSessionId
public String getSessionId()
获取会话标识。
Returns the session id.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:48–50setSessionId
public void setSessionId(String sessionId)
设置会话标识。
Sets the session id.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sessionId | String | 会话标识(类型 `String`)。The session id. |
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:52–54created
public AgentResponse created()
返回已创建。
Set status to created and return self.
AgentResponse返回AgentResponse。Returns agent response.
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:59–63inProgress
public AgentResponse inProgress()
将响应状态设置为进行中。
Set status to in_progress and return self.
AgentResponse返回AgentResponse。Returns agent response.
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:68–72completed
public AgentResponse completed()
返回已完成。
Set status to completed and return self.
AgentResponse返回AgentResponse。Returns agent response.
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:77–81failed
public AgentResponse failed(Error error)
设置失败。
Set status to failed with error and return self.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
error | Error | 错误(类型 `Error`)。The error. |
AgentResponse返回AgentResponse。Returns agent response.
源码Source
io/agentscope/runtime/engine/schemas/AgentResponse.java:86–90