mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Enables condensation by default (#7746)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
This commit is contained in:
@@ -7,10 +7,7 @@ import socketio
|
||||
|
||||
from openhands.controller.agent import Agent
|
||||
from openhands.core.config import AppConfig
|
||||
from openhands.core.config.condenser_config import (
|
||||
LLMSummarizingCondenserConfig,
|
||||
StructuredSummaryCondenserConfig,
|
||||
)
|
||||
from openhands.core.config.condenser_config import LLMSummarizingCondenserConfig
|
||||
from openhands.core.logger import OpenHandsLoggerAdapter
|
||||
from openhands.core.schema import AgentState
|
||||
from openhands.events.action import MessageAction, NullAction
|
||||
@@ -128,20 +125,9 @@ class Session:
|
||||
agent_config = self.config.get_agent_config(agent_cls)
|
||||
|
||||
if settings.enable_default_condenser:
|
||||
# If function-calling is active we can use the structured summary
|
||||
# condenser for more reliable summaries.
|
||||
if llm.is_function_calling_active():
|
||||
default_condenser_config = StructuredSummaryCondenserConfig(
|
||||
llm_config=llm.config, keep_first=3, max_size=80
|
||||
)
|
||||
|
||||
# Otherwise, we'll fall back to the unstructured summary condenser.
|
||||
# This is a good default but struggles more than the structured
|
||||
# summary condenser with long messages.
|
||||
else:
|
||||
default_condenser_config = LLMSummarizingCondenserConfig(
|
||||
llm_config=llm.config, keep_first=3, max_size=80
|
||||
)
|
||||
default_condenser_config = LLMSummarizingCondenserConfig(
|
||||
llm_config=llm.config, keep_first=3, max_size=80
|
||||
)
|
||||
|
||||
self.logger.info(f'Enabling default condenser: {default_condenser_config}')
|
||||
agent_config.condenser = default_condenser_config
|
||||
|
||||
Reference in New Issue
Block a user