ContentFilteredError

org.llm4s.error.ContentFilteredError
See theContentFilteredError companion object
@Stable

The provider's content filter stopped the call: it blocked the prompt, or stopped the reply, before or after some text (Gemini's promptFeedback.blockReason, or a finishReason such as SAFETY, RECITATION, PROHIBITED_CONTENT, BLOCKLIST or SPII). A reply the filter cut short is not a finished answer; a stream has already delivered the text before the stop, and the message says how much there was.

The provider is healthy, so a ReliableClient's circuit breaker counts this as neither a success nor a failure. As a NonRecoverableError, sending the same request again would be filtered the same way: the conversation must change before a retry.

Value parameters

promptBlocked

whether the prompt itself was blocked (blockReason), rather than the reply (finishReason)

provider

the client's provider name, e.g. Gemini

reason

the provider's reason, as it named it, e.g. SAFETY

Attributes

Companion
object
Source
ContentFilteredError.scala
Graph
Supertypes
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

Optional error code for programmatic handling

Optional error code for programmatic handling

Attributes

Inherited from:
LLMError
Source
LLMError.scala

Error correlation IDs for debugging

Error correlation IDs for debugging

Attributes

Inherited from:
LLMError
Source
LLMError.scala

Formatted error message with context

Formatted error message with context

Attributes

Inherited from:
LLMError
Source
LLMError.scala

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

override val context: Map[String, String]

Additional context information

Additional context information

Attributes

Source
ContentFilteredError.scala