mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Enables condensation by default (#7746)
Co-authored-by: Calvin Smith <calvin@all-hands.dev>
This commit is contained in:
parent
69d4a8df7c
commit
408ad1ff2b
@ -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
|
||||
|
||||
@ -30,7 +30,7 @@ class Settings(BaseModel):
|
||||
llm_base_url: str | None = None
|
||||
remote_runtime_resource_factor: int | None = None
|
||||
secrets_store: SecretStore = Field(default_factory=SecretStore, frozen=True)
|
||||
enable_default_condenser: bool = False
|
||||
enable_default_condenser: bool = True
|
||||
enable_sound_notifications: bool = False
|
||||
user_consents_to_analytics: bool | None = None
|
||||
sandbox_base_container_image: str | None = None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user