π OpenHands: AI-Driven Development
Fix summaries (#223)
Robert Brennan95c128c3d69a
diff --git a/agenthub/langchains_agent/utils/prompts.py b/agenthub/langchains_agent/utils/prompts.pyindex 1c7f297d20..a5dca94858 100644--- a/agenthub/langchains_agent/utils/prompts.py+++ b/agenthub/langchains_agent/utils/prompts.py@@ -165,11 +165,15 @@ def get_request_action_prompt(def parse_action_response(response: str) -> Action:parser = JsonOutputParser(pydantic_object=_ActionDict)action_dict = parser.parse(response)+ if 'content' in action_dict:+ # The LLM gets confused here. Might as well be robust+ action_dict['contents'] = action_dict.pop('content')+action = ACTION_TYPE_TO_CLASS[action_dict["action"]](**action_dict["args"])return actiondef parse_summary_response(response: str) -> List[Action]:parser = JsonOutputParser(pydantic_object=NewMonologue)parsed = parser.parse(response)- thoughts = [ACTION_TYPE_TO_CLASS[t['action']](**t['args']) for t in parsed['new_monologue']]- return thoughts+ #thoughts = [ACTION_TYPE_TO_CLASS[t['action']](**t['args']) for t in parsed['new_monologue']]+ return parsed['new_monologue']