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 Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product