AS AgentScopeAPI 手册 / API Reference

ApiErrorDetail

@JsonInclude(JsonInclude.Include.NON_NULL) public record ApiErrorDetail( String type, String code, String message, String param, @JsonProperty("session_id") String sessionId, @JsonProperty("retry_status") String retryStatus)
源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:24–66

承载 API 错误详情数据的记录类型。位于 io.agentscope.builder.web.api.error 包。核心成员包括 type、code、message、param、sessionId、retryStatus。

Shared typed error object for HTTP responses and session.error payloads.

记录组件摘要Record Component Summary

组件Component类型Type说明Description
typeString
执行类型相关操作。
Performs the type operation.
codeString
执行 `code` 方法。
Performs the code operation.
messageString
执行消息相关操作。
Performs the message operation.
paramString
执行参数相关操作。
Performs the param operation.
sessionIdString
执行会话标识相关操作。
Performs the session id operation.
retryStatusString
执行重试状态相关操作。
Performs the retry status operation.

方法摘要Method Summary

方法Method说明Description
public static ApiErrorDetail of(ApiErrorType type, String code, String message)
static
创建并返回实例。
Creates and returns an instance.
public ApiErrorDetail withParam(String param)
执行使用参数相关操作。
Performs the with param operation.
public ApiErrorDetail withSessionId(String sessionId)
执行使用会话标识相关操作。
Performs the with session id operation.
public ApiErrorDetail withRetryStatus(String retryStatus)
执行使用重试状态相关操作。
Performs the with retry status operation.
public Map<String, Object> toMap()
返回到映射。
Flattens into a payload map suitable for `session.error`.

记录组件详情Record Component Detail

type

String type

执行类型相关操作。

Performs the type operation.

源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:24–66

code

String code

执行 code 方法。

Performs the code operation.

源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:24–66

message

String message

执行消息相关操作。

Performs the message operation.

源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:24–66

param

String param

执行参数相关操作。

Performs the param operation.

源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:24–66

sessionId

String sessionId

执行会话标识相关操作。

Performs the session id operation.

源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:24–66

retryStatus

String retryStatus

执行重试状态相关操作。

Performs the retry status operation.

源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:24–66

方法详情Method Detail

of

public static ApiErrorDetail of(ApiErrorType type, String code, String message)
static

创建并返回实例。

Creates and returns an instance.

参数Parameters
名称Name类型Type说明Description
typeApiErrorType类型(类型 `ApiErrorType`)。The type.
codeStringcode(类型 `String`)。The code.
messageString消息(类型 `String`)。The message.
返回Returns ApiErrorDetail
返回ApiErrorDetail。Returns api error detail.
源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:33–35

withParam

public ApiErrorDetail withParam(String param)

执行使用参数相关操作。

Performs the with param operation.

参数Parameters
名称Name类型Type说明Description
paramString参数(类型 `String`)。The param.
返回Returns ApiErrorDetail
返回ApiErrorDetail。Returns api error detail.
源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:37–39

withSessionId

public ApiErrorDetail withSessionId(String sessionId)

执行使用会话标识相关操作。

Performs the with session id operation.

参数Parameters
名称Name类型Type说明Description
sessionIdString会话标识(类型 `String`)。The session id.
返回Returns ApiErrorDetail
返回ApiErrorDetail。Returns api error detail.
源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:41–43

withRetryStatus

public ApiErrorDetail withRetryStatus(String retryStatus)

执行使用重试状态相关操作。

Performs the with retry status operation.

参数Parameters
名称Name类型Type说明Description
retryStatusString重试状态(类型 `String`)。The retry status.
返回Returns ApiErrorDetail
返回ApiErrorDetail。Returns api error detail.
源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:45–47

toMap

public Map<String, Object> toMap()

返回到映射。

Flattens into a payload map suitable for session.error.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/builder/web/api/error/ApiErrorDetail.java:50–65
基于官方固定版本源码静态生成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.