mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Add experiment for agent config (#9861)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
parent
5553584056
commit
5b13cfc2a0
@ -1,5 +1,7 @@
|
||||
import os
|
||||
|
||||
from openhands.core.config.agent_config import AgentConfig
|
||||
from openhands.core.logger import openhands_logger as logger
|
||||
from openhands.server.session.conversation_init_data import ConversationInitData
|
||||
from openhands.utils.import_utils import get_impl
|
||||
|
||||
@ -11,6 +13,15 @@ class ExperimentManager:
|
||||
) -> ConversationInitData:
|
||||
return conversation_settings
|
||||
|
||||
@staticmethod
|
||||
def run_agent_config_variant_test(
|
||||
user_id: str, conversation_id: str, agent_config: AgentConfig
|
||||
) -> AgentConfig:
|
||||
logger.debug(
|
||||
f'Running agent config variant test for user_id={user_id}, conversation_id={conversation_id}'
|
||||
)
|
||||
return agent_config
|
||||
|
||||
|
||||
experiment_manager_cls = os.environ.get(
|
||||
'OPENHANDS_EXPERIMENT_MANAGER_CLS',
|
||||
|
||||
@ -28,6 +28,7 @@ from openhands.events.observation.agent import RecallObservation
|
||||
from openhands.events.observation.error import ErrorObservation
|
||||
from openhands.events.serialization import event_from_dict, event_to_dict
|
||||
from openhands.events.stream import EventStreamSubscriber
|
||||
from openhands.experiments.experiment_manager import ExperimentManagerImpl
|
||||
from openhands.llm.llm import LLM
|
||||
from openhands.runtime.runtime_status import RuntimeStatus
|
||||
from openhands.server.session.agent_session import AgentSession
|
||||
@ -157,6 +158,10 @@ class Session:
|
||||
llm = self._create_llm(agent_cls)
|
||||
agent_config = self.config.get_agent_config(agent_cls)
|
||||
|
||||
agent_config = ExperimentManagerImpl.run_agent_config_variant_test(
|
||||
self.user_id, self.sid, agent_config
|
||||
)
|
||||
|
||||
if settings.enable_default_condenser:
|
||||
# Default condenser chains three condensers together:
|
||||
# 1. a conversation window condenser that handles explicit
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user