Skip to main content

openhands.core.config.condenser_config

NoOpCondenserConfig Objects

class NoOpCondenserConfig(BaseModel)

Configuration for NoOpCondenser.

ObservationMaskingCondenserConfig Objects

class ObservationMaskingCondenserConfig(BaseModel)

Configuration for ObservationMaskingCondenser.

BrowserOutputCondenserConfig Objects

class BrowserOutputCondenserConfig(BaseModel)

Configuration for the BrowserOutputCondenser.

RecentEventsCondenserConfig Objects

class RecentEventsCondenserConfig(BaseModel)

Configuration for RecentEventsCondenser.

LLMSummarizingCondenserConfig Objects

class LLMSummarizingCondenserConfig(BaseModel)

Configuration for LLMCondenser.

AmortizedForgettingCondenserConfig Objects

class AmortizedForgettingCondenserConfig(BaseModel)

Configuration for AmortizedForgettingCondenser.

LLMAttentionCondenserConfig Objects

class LLMAttentionCondenserConfig(BaseModel)

Configuration for LLMAttentionCondenser.

condenser_config_from_toml_section

def condenser_config_from_toml_section(
data: dict,
llm_configs: dict | None = None) -> dict[str, CondenserConfig]

Create a CondenserConfig instance from a toml dictionary representing the [condenser] section.

For CondenserConfig, the handling is different since it's a union type. The type of condenser is determined by the 'type' field in the section.

Example:

Parse condenser config like: [condenser] type = "noop"

For condensers that require an LLM config, you can specify the name of an LLM config: [condenser] type = "llm" llm_config = "my_llm" # References [llm.my_llm] section

Arguments:

  • data - The TOML dictionary representing the [condenser] section.
  • llm_configs - Optional dictionary of LLMConfig objects keyed by name.

Returns:

dict[str, CondenserConfig]: A mapping where the key "condenser" corresponds to the configuration.

create_condenser_config

def create_condenser_config(condenser_type: str,
data: dict) -> CondenserConfig

Create a CondenserConfig instance based on the specified type.

Arguments:

  • condenser_type - The type of condenser to create.
  • data - The configuration data.

Returns:

A CondenserConfig instance.

Raises:

  • ValueError - If the condenser type is unknown.
  • ValidationError - If the provided data fails validation for the condenser type.