[agent] Read-only Agent (#6947)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Xingyao Wang
2025-04-18 14:46:24 -04:00
committed by GitHub
parent c6092291ce
commit 91c691d526
18 changed files with 1014 additions and 21 deletions

View File

@@ -87,6 +87,8 @@ class CodeActAgent(Agent):
self.condenser = Condenser.from_config(self.config.condenser)
logger.debug(f'Using condenser: {type(self.condenser)}')
self.response_to_actions_fn = codeact_function_calling.response_to_actions
def reset(self) -> None:
"""Resets the CodeAct Agent."""
super().reset()
@@ -152,7 +154,7 @@ class CodeActAgent(Agent):
params['extra_body'] = {'metadata': state.to_llm_metadata(agent_name=self.name)}
response = self.llm.completion(**params)
logger.debug(f'Response from LLM: {response}')
actions = codeact_function_calling.response_to_actions(response)
actions = self.response_to_actions_fn(response)
logger.debug(f'Actions after response_to_actions: {actions}')
for action in actions:
self.pending_actions.append(action)