org.llm4s.error.ContextError
See theContextError companion object
@Stable
final case class ContextError extends LLMError, NonRecoverableError
Context management related errors for token windows and conversation handling.
This is a NonRecoverableError. Build one with the smart constructors in the companion object. Its context map is "contextType" -> contextType plus the details entries.
Value parameters
- contextType
-
short tag for the kind of context operation that failed (e.g.
"tokenBudget"), stored incontextunder the keycontextType - details
-
extra key/value pairs about the failure, merged into
context; empty for constructors that set none - message
-
human-readable description of the failure
Attributes
- Example
-
val error = ContextError.tokenBudgetExceeded(currentTokens = 1200, budget = 1000) error.context("contextType") // "tokenBudget" error.context("currentTokens") // "1200" - Companion
- object
- Graph
-
- Supertypes
-
trait NonRecoverableErrortrait LLMErrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Members list
In this article