SummaryCompressor

org.llm4s.agent.harness.SummaryCompressor
See theSummaryCompressor companion trait
@Experimental

Attributes

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

Members list

Value members

Concrete methods

Core's HistoryCompressor digest, with no model call: each user-assistant exchange becomes a line of the identifiers, decisions, errors and outcomes found in it. An extension appends the new messages' digest to the summary; when that would be over maxTokens, the summary and the new messages are digested together, which HistoryCompressor consolidates within the cap.

Core's HistoryCompressor digest, with no model call: each user-assistant exchange becomes a line of the identifiers, decisions, errors and outcomes found in it. An extension appends the new messages' digest to the summary; when that would be over maxTokens, the summary and the new messages are digested together, which HistoryCompressor consolidates within the cap.

Attributes

def model(client: LLMClient, options: CompletionOptions, maxInputTokens: Int): SummaryCompressor

A summary the model writes, through context.accounted(client): given the summary so far and a transcript of the new messages, it returns the extended summary, asked to stay within maxTokens (options' maxTokens is set to it). A transcript over maxInputTokens (four characters a token) is folded in chunks, one call each, each extending the summary the last call produced; a single message larger than a chunk is cut, and says so.

A summary the model writes, through context.accounted(client): given the summary so far and a transcript of the new messages, it returns the extended summary, asked to stay within maxTokens (options' maxTokens is set to it). A transcript over maxInputTokens (four characters a token) is folded in chunks, one call each, each extending the summary the last call produced; a single message larger than a chunk is cut, and says so.

Attributes

Concrete fields

The default for a model compressor's maxInputTokens.

The default for a model compressor's maxInputTokens.

Attributes

val MinInputTokens: Int

The least maxInputTokens of a model compressor: a cut line keeps 16 characters beside its marker.

The least maxInputTokens of a model compressor: a cut line keeps 16 characters beside its marker.

Attributes

val MinSummaryTokens: Int

The least bound a summary may have: a digest summary's counted media line (at most about 60 characters) always fits in half of it, whole.

The least bound a summary may have: a digest summary's counted media line (at most about 60 characters) always fits in half of it, whole.

Attributes