AS AgentScopeAPI 手册 / API Reference

EmbeddingException

public class EmbeddingException extends RuntimeException
源码Source 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.

参数Parameters
名称Name类型Type说明Description
messageString错误消息。the error message
源码Source io/agentscope/core/embedding/EmbeddingException.java:34–38

EmbeddingException

public EmbeddingException(String message, Throwable cause)

初始化 EmbeddingException 实例。

Creates a new EmbeddingException with the given message and cause.

参数Parameters
名称Name类型Type说明Description
messageString错误消息。the error message
causeThrowablecause(类型 `Throwable`)。the cause of this exception
源码Source io/agentscope/core/embedding/EmbeddingException.java:46–50

EmbeddingException

public EmbeddingException(String message, String modelName, String provider)

初始化 EmbeddingException 实例。

Creates a new EmbeddingException with the given message, model name, and provider.

参数Parameters
名称Name类型Type说明Description
messageString错误消息。the error message
modelNameString模型名称(类型 `String`)。the name of the model that failed
providerString提供者(类型 `String`)。the provider name (e.g., "dashscope", "openai")
源码Source io/agentscope/core/embedding/EmbeddingException.java:59–63

EmbeddingException

public EmbeddingException(String message, Throwable cause, String modelName, String provider)

初始化 EmbeddingException 实例。

Creates a new EmbeddingException with the given message, cause, model name, and provider.

参数Parameters
名称Name类型Type说明Description
messageString错误消息。the error message
causeThrowablecause(类型 `Throwable`)。the cause of this exception
modelNameString模型名称(类型 `String`)。the name of the model that failed
providerString提供者(类型 `String`)。the provider name (e.g., "dashscope", "openai")
源码Source io/agentscope/core/embedding/EmbeddingException.java:73–77

方法详情Method Detail

getModelName

public String getModelName()

获取模型名称。

Gets the model name that failed.

返回Returns String
返回字符串结果。the model name, or null if not set
源码Source io/agentscope/core/embedding/EmbeddingException.java:84–86

getProvider

public String getProvider()

获取提供者名称。

Gets the provider name.

返回Returns String
返回字符串结果。the provider name, or null if not set
源码Source io/agentscope/core/embedding/EmbeddingException.java:93–95
基于官方固定版本源码静态生成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.