MCPcopy Create free account
hub / github.com/SamuelSchmidgall/AgentLaboratory / parse_command

Method parse_command

mlesolver.py:126–138  ·  view source on GitHub ↗
(self, *args)

Source from the content-addressed store, hash-verified

124 return False
125
126 def parse_command(self, *args) -> tuple:
127 cmd_str, codelines, datasetcode = args[0], args[1], args[2]
128 success = True
129 try:
130 text = extract_prompt(cmd_str, "EDIT").split("\n")
131 if len(text) == 0: return False, None
132 lines_to_edit = text[0].split(" ")
133 if len(lines_to_edit) != 2: return False, None
134 lines_to_edit = [int(_) for _ in lines_to_edit]
135 if len(text[1:]) == 0: return False, None
136 return success, (lines_to_edit[0], lines_to_edit[1], codelines, text[1:], datasetcode)
137 except Exception as e:
138 return False, (None, None, None, None, None)
139
140
141def get_score(outlined_plan, code, code_return, REWARD_MODEL_LLM, attempts=3, openai_api_key=None):

Callers 1

process_commandMethod · 0.45

Calls 1

extract_promptFunction · 0.85

Tested by

no test coverage detected