UnscriptedCallError

org.llm4s.testkit.UnscriptedCallError
See theUnscriptedCallError companion object

The error a ScriptedLLMClient returns for a call its script has no reply for: a call past the end of a ScriptedLLMClient.sequence, or a conversation no case of ScriptedLLMClient.respondingTo matches.

It is a type of its own, so a test can tell "the code made a call I did not script" apart from every error a real provider returns, and from the errors a test scripts with Reply.failure:

client.complete(conversation, options) match {
 case Left(e: UnscriptedCallError) => e.callNumber   // 3
 case other                        => ...
}

It is a NonRecoverableError, so a ReliableClient around the scripted client does not retry it.

Value parameters

callNumber

which call had no reply, counting from 1

lastMessage

the last message of the conversation, as role: "text" cut to 80 characters; None when the conversation had no messages

reason

why there was none, for example the script has 2 replies

Attributes

Companion
object
Graph
Supertypes
trait LLMError
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def context: Map[String, String]

Additional context information

Additional context information

Attributes

Definition Classes
override def message: String

Human-readable error message

Human-readable error message

Attributes

Definition Classes

Inherited methods

def code: Option[String]

Optional error code for programmatic handling

Optional error code for programmatic handling

Attributes

Inherited from:
LLMError
def correlationId: Option[String]

Error correlation IDs for debugging

Error correlation IDs for debugging

Attributes

Inherited from:
LLMError
def formatted: String

Formatted error message with context

Formatted error message with context

Attributes

Inherited from:
LLMError
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product