LLMError

org.llm4s.error.LLMError
See theLLMError companion trait
object LLMError

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
LLMError.type

Members list

Value members

Concrete methods

def apiCallFailed(provider: String, message: String, statusCode: Option[Int], responseBody: Option[String]): APIError
def invalidImageInput(field: String, value: String, reason: String): InvalidInputError
def isRecoverable(error: LLMError): Boolean

Whether the error may succeed if tried again, perhaps after the caller does something first: true for a RecoverableError, false for anything else.

Whether the error may succeed if tried again, perhaps after the caller does something first: true for a RecoverableError, false for anything else.

It is total. An error that carries neither marker - a library error whose recoverability depends on more than its type, such as EmbeddingError, or a custom LLMError that does not say - is not recoverable, as org.llm4s.reliability.RetryPolicy.isRetryable and ErrorRecovery already treat it: nothing says it can succeed on a retry. Mix in RecoverableError or NonRecoverableError to say which an error is.

This is wider than what the library retries by itself. org.llm4s.reliability.RetryPolicy.isRetryable is the rule for automatic retry of the identical request; it is derived from this check and excludes a client-error response and an OptimisticLockFailure, which need the caller first.

Value parameters

error

LLMError

Attributes

Returns

whether the error is recoverable

def nonRecoverableErrors(errors: List[LLMError]): List[LLMError]

The errors that are not isRecoverable: every NonRecoverableError, and every error with no marker.

The errors that are not isRecoverable: every NonRecoverableError, and every error with no marker.

Attributes

def processingFailed(operation: String, message: String, cause: Option[Throwable]): ProcessingError
def recoverableErrors(errors: List[LLMError]): List[LLMError]

The errors that are isRecoverable.

The errors that are isRecoverable.

Attributes

def show(error: LLMError): String

Static show method - always works

Static show method - always works

Attributes