Outcome

org.llm4s.repl.Outcome
@Experimental
enum Outcome[+A]

What a REPL helper returns: the value, or the error that stopped it. A REPL prints it as the value itself, or as error: <kind>: <message and hint>, never as a stack trace. A script that wants a Result calls toResult, or uses the helpers of strict.

val answer = ask("What is a monad?")
answer.getOrElse("")      // the text, or "" when the call failed
answer.toResult           // Right(text) or Left(error)

Attributes

Graph
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Type members

Enum entries

final case class Done[+A](value: A)

The helper's value.

The helper's value.

Attributes

final case class Failed[+A](error: LLMError)

The error that stopped the helper; it has already been printed.

The error that stopped the helper; it has already been printed.

Attributes