syntax

org.llm4s.syntax.syntax
object syntax

Extension methods for Result[A] (Either[LLMError, A]).

Import org.llm4s.syntax.syntax._ to bring these into scope.

Attributes

Example
import org.llm4s.syntax.syntax._
val result: Result[String] = Right("hello")
result
 .recover { case _: RateLimitError => "fallback" }
 .tap(println)
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
syntax.type

Members list

Type members

Classlikes

final implicit class ResultOps[A](result: Result[A]) extends AnyVal

Enriches Result[A] with combinators for error handling and side effects.

Enriches Result[A] with combinators for error handling and side effects.

These methods parallel standard Either and Try combinators but are typed specifically for LLMError on the left side, making the failure domain explicit at each call site.

Attributes

Supertypes
class AnyVal
trait Matchable
class Any

Implicits

Implicits

final implicit def ResultOps[A](result: Result[A]): ResultOps[A]

Enriches Result[A] with combinators for error handling and side effects.

Enriches Result[A] with combinators for error handling and side effects.

These methods parallel standard Either and Try combinators but are typed specifically for LLMError on the left side, making the failure domain explicit at each call site.

Attributes