diff --git a/llm_cmd.py b/llm_cmd.py index 33b9d33..a3f4932 100644 --- a/llm_cmd.py +++ b/llm_cmd.py @@ -30,6 +30,7 @@ def cmd(args, model, system, key): if model_obj.needs_key: model_obj.key = llm.get_key(key, model_obj.needs_key, model_obj.key_env_var) result = model_obj.prompt(prompt, system=system or SYSTEM_PROMPT) + result = '\n'.join([i for i in str(result).splitlines() if not i.startswith('```')]) interactive_exec(str(result)) def interactive_exec(command): @@ -46,4 +47,4 @@ def interactive_exec(command): ) print(output.decode()) except subprocess.CalledProcessError as e: - print(f"Command failed with error (exit status {e.returncode}): {e.output.decode()}") \ No newline at end of file + print(f"Command failed with error (exit status {e.returncode}): {e.output.decode()}")