f""" Get the diff of the 'autoagent'.
(context_variables)
| 20 | |
| 21 | @register_tool("get_diff") |
| 22 | def get_diff(context_variables): |
| 23 | f""" |
| 24 | Get the diff of the 'autoagent'. |
| 25 | """ |
| 26 | env: Union[DockerEnv, LocalEnv] = context_variables.get("code_env", LocalEnv()) |
| 27 | diff_command = f"cd {env.docker_workplace}/autoagent && git add -N . && git diff" |
| 28 | result = env.run_command(diff_command) |
| 29 | if result['status'] == 0: |
| 30 | return result['result'].strip() |
| 31 | else: |
| 32 | return f"Failed to get the diff. Error: {result['result'].strip()}" |
| 33 | |
| 34 | @register_tool("stage_files") |
| 35 | def stage_files(context_variables, file_paths=None): |
no test coverage detected