Custom
org.llm4s.agent.PruningStrategy.Custom
case class Custom(fn: Seq[Message] => Seq[Message]) extends PruningStrategy
Custom pruning function. Receives the history before the current turn (the latest user message onwards, which is never pruned and is appended afterwards) and returns the messages to send in its place - a subset, or copies it has changed. The result is then repaired: a tool call left without its results, or a result without its call, is dropped, and the history starts with a user message. The function should be pure (no side effects) and deterministic.
Value parameters
- fn
-
Function that takes messages and returns pruned messages
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait PruningStrategyclass Objecttrait Matchableclass Any
Members list
In this article