AS AgentScopeAPI 手册 / API Reference

OpenAIOfficialModelException

public class OpenAIOfficialModelException extends ModelException implements ModelHttpException
源码Source io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:32–101

用于openai-official提供者的异常类型。位于 io.agentscope.extensions.model.openaiofficial 包,继承自 ModelException,实现 ModelHttpException。核心成员包括 getStatusCode、isRetryableHttpStatus、OpenAIOfficialModelException。

Exception type for the openai-official provider.

Extends ModelException and implements ModelHttpException so that HTTP-status-aware retry classification works through both the core ExecutionConfig.RETRYABLE_ERRORS safety net and the module's own retryOn predicate.

Overrides #isRetryableHttpStatus() to include 408 and 409 in addition to the core default (429 and 5xx). This aligns with the SDK RetryingHttpClient.shouldRetry status-code set {408, 409, 429, >=500}.

构造器摘要Constructor Summary

构造器Constructor说明Description
public OpenAIOfficialModelException(String message, Throwable cause, String modelName)
初始化 `OpenAIOfficialModelException` 实例。
Creates an exception with no HTTP status (for non-HTTP SDK failures such as `OpenAIIoException`, `OpenAIInvalidDataException`, or validation errors).
public OpenAIOfficialModelException(String message, Throwable cause, String modelName, Integer statusCode)
初始化 `OpenAIOfficialModelException` 实例。
Creates an exception with an HTTP status code (for `OpenAIServiceException` subclasses such as `BadRequestException`, `RateLimitException`, etc.).
public OpenAIOfficialModelException(String message)
初始化 `OpenAIOfficialModelException` 实例。
Creates a validation/non-retryable exception with no cause and no HTTP status.
public OpenAIOfficialModelException(String message, String modelName)
初始化 `OpenAIOfficialModelException` 实例。
Creates a validation/non-retryable exception with no cause, no HTTP status, but with a known model name.

方法摘要Method Summary

方法Method说明Description
public Integer getStatusCode()
获取 `getStatusCode`。
Returns the status code.
public boolean isRetryableHttpStatus()
判断是否 `isRetryableHttpStatus`。
Returns whether the retryable http status.

构造器详情Constructor Detail

OpenAIOfficialModelException

public OpenAIOfficialModelException(String message, Throwable cause, String modelName)

初始化 OpenAIOfficialModelException 实例。

Creates an exception with no HTTP status (for non-HTTP SDK failures such as OpenAIIoException, OpenAIInvalidDataException, or validation errors).

参数Parameters
名称Name类型Type说明Description
messageString错误消息。the error message
causeThrowablecause(类型 `Throwable`)。the underlying SDK exception, or null
modelNameString模型名称(类型 `String`)。the model name, or null if unknown
源码Source io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:44–47

OpenAIOfficialModelException

public OpenAIOfficialModelException(String message, Throwable cause, String modelName, Integer statusCode)

初始化 OpenAIOfficialModelException 实例。

Creates an exception with an HTTP status code (for OpenAIServiceException subclasses such as BadRequestException, RateLimitException, etc.).

参数Parameters
名称Name类型Type说明Description
messageString错误消息。the error message
causeThrowablecause(类型 `Throwable`)。the underlying SDK exception
modelNameString模型名称(类型 `String`)。the model name, or null if unknown
statusCodeInteger状态 Code(类型 `Integer`)。the HTTP status code from the SDK exception
源码Source io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:58–62

OpenAIOfficialModelException

public OpenAIOfficialModelException(String message)

初始化 OpenAIOfficialModelException 实例。

Creates a validation/non-retryable exception with no cause and no HTTP status.

参数Parameters
名称Name类型Type说明Description
messageString校验消息。the validation message
源码Source io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:69–72

OpenAIOfficialModelException

public OpenAIOfficialModelException(String message, String modelName)

初始化 OpenAIOfficialModelException 实例。

Creates a validation/non-retryable exception with no cause, no HTTP status, but with a known model name.

参数Parameters
名称Name类型Type说明Description
messageString校验消息。the validation message
modelNameString模型名称(类型 `String`)。the model name, or null if unknown
源码Source io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:81–84

方法详情Method Detail

getStatusCode

public Integer getStatusCode()

获取 getStatusCode。

Returns the status code.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:86–89

isRetryableHttpStatus

public boolean isRetryableHttpStatus()

判断是否 isRetryableHttpStatus。

Returns whether the retryable http status.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:91–100

继承成员Inherited Members

继承自Methods inherited from ModelException
基于官方固定版本源码静态生成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.