Safety

org.llm4s.core.safety.Safety
object Safety

Pure helpers for safe, typed error handling. All helpers return Either-based results or cats ValidatedNec for aggregation.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Safety.type

Members list

Type members

Classlikes

object future

Minimal Future helpers

Minimal Future helpers

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
future.type

Value members

Concrete methods

def fromOption[A](oa: Option[A], ifEmpty: => LLMError): Result[A]
def fromTry[A](t: Try[A])(implicit em: ErrorMapper): Result[A]
def mapError[A](r: Result[A])(f: LLMError => LLMError): Result[A]
def safely[A](thunk: => A)(implicit em: ErrorMapper): Result[A]

Pure helpers

Pure helpers

Attributes

def sequenceV[A](xs: List[Result[A]]): ValidatedNec[LLMError, List[A]]

Sequence results and accumulate all errors using ValidatedNec.

Sequence results and accumulate all errors using ValidatedNec.

Attributes