Package io.agentscope.core.embedding
Class EmbeddingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.agentscope.core.embedding.EmbeddingException
- All Implemented Interfaces:
Serializable
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.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEmbeddingException(String message) Creates a new EmbeddingException with the given message.EmbeddingException(String message, String modelName, String provider) Creates a new EmbeddingException with the given message, model name, and provider.EmbeddingException(String message, Throwable cause) Creates a new EmbeddingException with the given message and cause.EmbeddingException(String message, Throwable cause, String modelName, String provider) Creates a new EmbeddingException with the given message, cause, model name, and provider. -
Method Summary
Modifier and TypeMethodDescriptionGets the model name that failed.Gets the provider name.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
EmbeddingException
Creates a new EmbeddingException with the given message.- Parameters:
message- the error message
-
EmbeddingException
Creates a new EmbeddingException with the given message and cause.- Parameters:
message- the error messagecause- the cause of this exception
-
EmbeddingException
Creates a new EmbeddingException with the given message, model name, and provider.- Parameters:
message- the error messagemodelName- the name of the model that failedprovider- the provider name (e.g., "dashscope", "openai")
-
EmbeddingException
Creates a new EmbeddingException with the given message, cause, model name, and provider.- Parameters:
message- the error messagecause- the cause of this exceptionmodelName- the name of the model that failedprovider- the provider name (e.g., "dashscope", "openai")
-
-
Method Details
-
getModelName
Gets the model name that failed.- Returns:
- the model name, or null if not set
-
getProvider
Gets the provider name.- Returns:
- the provider name, or null if not set
-