Package de.xima.fc.prompt.service
Class RequestRefusedException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- de.xima.fc.prompt.service.PromptExecutionException
-
- de.xima.fc.prompt.service.RequestRefusedException
-
- All Implemented Interfaces:
Serializable
public final class RequestRefusedException extends PromptExecutionException
Exception thrown when executing a prompt query and the prompt service refuses to process the request, e.g. because violates its usage policies or contains inappropriate content. For example, an LLM service might refuse to process requests that contain hate speech or explicit content.- Since:
- 8.5.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRequestRefusedException.BuilderBuilder for aRequestRefusedException.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RequestRefusedException.Builderbuilder()Creates a new builder forRequestRefusedException.StringrefusalReason()Gets the reason why the request was refused.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
refusalReason
public String refusalReason()
Gets the reason why the request was refused. This can be used to provide more context about the refusal.- Returns:
- The reason why the request was refused.
-
builder
public static RequestRefusedException.Builder builder()
Creates a new builder forRequestRefusedException.- Returns:
- The new builder.
-
-