Header menu logo Nao

ConversationWindow Module

Functions and values

Function or value Description

apply strategy conversation

Full Usage: apply strategy conversation

Parameters:
Returns: Conversation

Apply a window strategy to a conversation

strategy : WindowStrategy
conversation : Conversation
Returns: Conversation

applyLastN n conversation

Full Usage: applyLastN n conversation

Parameters:
Returns: Conversation

Apply LastN strategy: keep the last N messages

n : int
conversation : Conversation
Returns: Conversation

applyTokenBudget maxTokens conversation

Full Usage: applyTokenBudget maxTokens conversation

Parameters:
Returns: Conversation

Apply TokenBudget strategy: keep as many recent messages as fit within budget

maxTokens : int
conversation : Conversation
Returns: Conversation

estimateTokens msg

Full Usage: estimateTokens msg

Parameters:
Returns: int

Estimate token count for a message (approximation: ~4 chars per token)

msg : Message
Returns: int

partitionForSummary threshold conversation

Full Usage: partitionForSummary threshold conversation

Parameters:
Returns: Conversation * Conversation

Mark messages that should be summarized (those beyond the threshold)

threshold : int
conversation : Conversation
Returns: Conversation * Conversation

Type something to start searching.