ContextError

org.llm4s.error.ContextError
See theContextError companion class
object ContextError

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def artifactStoreFailed(operation: String, key: String, reason: String): ContextError

An artifact store operation failed. ToolOutputCompressor raises it, with operation "store", when it cannot store a tool output it externalizes.

An artifact store operation failed. ToolOutputCompressor raises it, with operation "store", when it cannot store a tool output it externalizes.

Value parameters

key

the artifact key the operation was for

operation

the store operation that failed (e.g. "store")

reason

why the operation failed

Attributes

Returns

an error with contextType "artifactStore" and details operation and key

def compressionFailed(strategy: String, reason: String): ContextError

A compression strategy failed.

A compression strategy failed.

Value parameters

reason

why the compression failed

strategy

the name of the compression strategy

Attributes

Returns

an error with contextType "compression" and detail strategy

def contextPipelineFailed(step: String, reason: String): ContextError

A step of the context management pipeline failed.

A step of the context management pipeline failed.

Value parameters

reason

why the step failed

step

the name of the step that failed

Attributes

Returns

an error with contextType "pipeline" and detail failedStep

def conversationTooLarge(messageCount: Int, minRequired: Int): ContextError

The conversation has too many messages to fit the budget.

The conversation has too many messages to fit the budget.

Value parameters

messageCount

the number of messages in the conversation

minRequired

the minimum number of messages that would be required to fit the budget

Attributes

Returns

an error with contextType "conversationSize" and details messageCount and minRequired

def emptyResult(operation: String): ContextError

A context operation left the conversation empty.

A context operation left the conversation empty.

Value parameters

operation

the operation that produced the empty conversation

Attributes

Returns

an error with contextType "emptyResult" and no details

def externalizationFailed(contentType: String, size: Long, reason: String): ContextError

Moving content out of the context (externalization) failed.

Moving content out of the context (externalization) failed.

Value parameters

contentType

the type of the content being externalized

reason

why the externalization failed

size

the size of the content, in bytes

Attributes

Returns

an error with contextType "externalization" and details contentType and size

def invalidTrimming(reason: String): ContextError

A trimming operation on the context is invalid.

A trimming operation on the context is invalid.

Value parameters

reason

why the trimming is invalid

Attributes

Returns

an error with contextType "trimming" and no details

def llmCompressionFailed(modelName: String, reason: String): ContextError

Compression by an LLM failed. LLMCompressor raises it, with the name "digest", when the LLM call that compresses the history digest fails.

Compression by an LLM failed. LLMCompressor raises it, with the name "digest", when the LLM call that compresses the history digest fails.

Value parameters

modelName

the name given to the LLM compression that failed (LLMCompressor passes "digest")

reason

why the compression failed

Attributes

Returns

an error with contextType "llmCompression" and detail modelName

def schemaCompressionFailed(schema: String, reason: String): ContextError

Schema-aware compression failed. ToolOutputCompressor raises it, with the schema "ToolOutputCompressor", when the content of a tool output cannot be parsed as JSON.

Schema-aware compression failed. ToolOutputCompressor raises it, with the schema "ToolOutputCompressor", when the content of a tool output cannot be parsed as JSON.

Value parameters

reason

why the compression failed

schema

the schema (or compressor) the compression was based on

Attributes

Returns

an error with contextType "schemaCompression" and detail schema

def semanticBlockingFailed(reason: String): ContextError

Grouping messages into semantic blocks failed.

Grouping messages into semantic blocks failed.

Value parameters

reason

why the grouping failed

Attributes

Returns

an error with contextType "semanticBlocking" and no details

def summarizationFailed(blockCount: Int, reason: String): ContextError

Summarizing semantic blocks failed.

Summarizing semantic blocks failed.

Value parameters

blockCount

the number of semantic blocks being summarized

reason

why the summarization failed

Attributes

Returns

an error with contextType "summarization" and detail blockCount

def tokenBudgetExceeded(currentTokens: Int, budget: Int): ContextError

The token count of the context is above its budget.

The token count of the context is above its budget.

Value parameters

budget

the maximum number of tokens allowed

currentTokens

the number of tokens the context uses

Attributes

Returns

an error with contextType "tokenBudget" and details currentTokens and budget

def tokenEstimationFailed(content: String, reason: String): ContextError

Estimating the token count of some content failed.

Estimating the token count of some content failed.

Value parameters

content

the content whose tokens were being estimated; only its length is kept

reason

why the estimation failed

Attributes

Returns

an error with contextType "tokenEstimation" and detail contentLength (the length of content, in characters)

def toolCompressionFailed(toolCallId: String, reason: String): ContextError

Compressing the output of a tool call failed.

Compressing the output of a tool call failed.

Value parameters

reason

why the compression failed

toolCallId

the id of the tool call whose output was being compressed

Attributes

Returns

an error with contextType "toolCompression" and detail toolCallId

def unapply(error: ContextError): Option[(String, String, Map[String, String])]

Unapply extractor for pattern matching: the error's message, contextType and details.

Unapply extractor for pattern matching: the error's message, contextType and details.

Attributes