EmbeddingException
public class EmbeddingException extends RuntimeException
io/agentscope/core/embedding/EmbeddingException.java:24–96向量化异常,表示执行过程中的错误。位于 io.agentscope.core.embedding 包,继承自 RuntimeException。核心成员包括 getModelName、getProvider、EmbeddingException。
Exception thrown when embedding generation fails.
This exception is used to wrap errors from embedding model API calls, providing context about the model and provider that failed.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public EmbeddingException(String message) | 初始化 `EmbeddingException` 实例。 Creates a new EmbeddingException with the given message. |
public EmbeddingException(String message, Throwable cause) | 初始化 `EmbeddingException` 实例。 Creates a new EmbeddingException with the given message and cause. |
public EmbeddingException(String message, String modelName, String provider) | 初始化 `EmbeddingException` 实例。 Creates a new EmbeddingException with the given message, model name, and provider. |
public EmbeddingException(String message, Throwable cause, String modelName, String provider) | 初始化 `EmbeddingException` 实例。 Creates a new EmbeddingException with the given message, cause, model name, and provider. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String getModelName() | 获取模型名称。 Gets the model name that failed. |
public String getProvider() | 获取提供者名称。 Gets the provider name. |
构造器详情Constructor Detail
EmbeddingException
public EmbeddingException(String message)
初始化 EmbeddingException 实例。
Creates a new EmbeddingException with the given message.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 错误消息。the error message |
io/agentscope/core/embedding/EmbeddingException.java:34–38EmbeddingException
public EmbeddingException(String message, Throwable cause)
初始化 EmbeddingException 实例。
Creates a new EmbeddingException with the given message and cause.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 错误消息。the error message |
cause | Throwable | cause(类型 `Throwable`)。the cause of this exception |
io/agentscope/core/embedding/EmbeddingException.java:46–50EmbeddingException
public EmbeddingException(String message, String modelName, String provider)
初始化 EmbeddingException 实例。
Creates a new EmbeddingException with the given message, model name, and provider.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 错误消息。the error message |
modelName | String | 模型名称(类型 `String`)。the name of the model that failed |
provider | String | 提供者(类型 `String`)。the provider name (e.g., "dashscope", "openai") |
io/agentscope/core/embedding/EmbeddingException.java:59–63EmbeddingException
public EmbeddingException(String message, Throwable cause, String modelName, String provider)
初始化 EmbeddingException 实例。
Creates a new EmbeddingException with the given message, cause, model name, and provider.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 错误消息。the error message |
cause | Throwable | cause(类型 `Throwable`)。the cause of this exception |
modelName | String | 模型名称(类型 `String`)。the name of the model that failed |
provider | String | 提供者(类型 `String`)。the provider name (e.g., "dashscope", "openai") |
io/agentscope/core/embedding/EmbeddingException.java:73–77方法详情Method Detail
getModelName
public String getModelName()
获取模型名称。
Gets the model name that failed.
Stringio/agentscope/core/embedding/EmbeddingException.java:84–86getProvider
public String getProvider()
获取提供者名称。
Gets the provider name.
Stringio/agentscope/core/embedding/EmbeddingException.java:93–95