mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-25 21:36:52 +08:00
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Graham Neubig <neubig@gmail.com> Co-authored-by: Engel Nyst <enyst@users.noreply.github.com>
23 lines
681 B
Python
23 lines
681 B
Python
from __future__ import annotations
|
|
|
|
from openhands.core.config.condenser_config import NoOpCondenserConfig
|
|
from openhands.llm.llm_registry import LLMRegistry
|
|
from openhands.memory.condenser.condenser import Condensation, Condenser, View
|
|
|
|
|
|
class NoOpCondenser(Condenser):
|
|
"""A condenser that does nothing to the event sequence."""
|
|
|
|
def condense(self, view: View) -> View | Condensation:
|
|
"""Returns the list of events unchanged."""
|
|
return view
|
|
|
|
@classmethod
|
|
def from_config(
|
|
cls, config: NoOpCondenserConfig, llm_registry: LLMRegistry
|
|
) -> NoOpCondenser:
|
|
return NoOpCondenser()
|
|
|
|
|
|
NoOpCondenser.register_config(NoOpCondenserConfig)
|