类 ModelException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.agentscope.core.model.ModelException
- 所有已实现的接口:
Serializable
Exception thrown when model operations fail.
This exception provides a unified way to handle errors from different model providers.
- 另请参阅:
-
构造器概要
构造器构造器说明ModelException(String message) Creates a ModelException with a message.ModelException(String message, String modelName, String provider) Creates a ModelException with message and model information.ModelException(String message, Throwable cause) Creates a ModelException with a message and cause.ModelException(String message, Throwable cause, String modelName, String provider) Creates a ModelException with message, cause, and model information. -
方法概要
修饰符和类型方法说明Gets the name of the model that caused the error.Gets the provider of the model that caused the error.toString()
-
构造器详细资料
-
ModelException
Creates a ModelException with a message.Use this constructor for general model errors when specific model/provider information is not available or relevant.
- 参数:
message- the error message
-
ModelException
Creates a ModelException with a message and cause.Use this constructor when wrapping another exception that caused the model error.
- 参数:
message- the error messagecause- the underlying cause of the exception
-
ModelException
Creates a ModelException with message and model information.Use this constructor when the error is specific to a particular model and provider, allowing for more targeted error handling and debugging.
- 参数:
message- the error messagemodelName- the name of the model that caused the errorprovider- the provider of the model (e.g., "openai", "dashscope")
-
ModelException
Creates a ModelException with message, cause, and model information.Use this constructor when wrapping another exception that caused the model error, and the error is specific to a particular model and provider.
- 参数:
message- the error messagecause- the underlying cause of the exceptionmodelName- the name of the model that caused the errorprovider- the provider of the model (e.g., "openai", "dashscope")
-
-
方法详细资料