From 8edd3b9aad2cf4d47cd983c88e30d7a997599cc6 Mon Sep 17 00:00:00 2001 From: Liu Yitao Date: Mon, 29 Jan 2024 18:22:13 -0500 Subject: [PATCH] Fix examples --- .../c56de254-a3ec-414e-81a6-83d2ce8c41fa.json | 23 ++++++++++++++++--- .../cc9d4f34-1ca0-4a1b-8ff2-09302696acb9.json | 22 +++++++++++++++--- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/evaluation_examples/examples/os/c56de254-a3ec-414e-81a6-83d2ce8c41fa.json b/evaluation_examples/examples/os/c56de254-a3ec-414e-81a6-83d2ce8c41fa.json index 27abbf7..7583dab 100644 --- a/evaluation_examples/examples/os/c56de254-a3ec-414e-81a6-83d2ce8c41fa.json +++ b/evaluation_examples/examples/os/c56de254-a3ec-414e-81a6-83d2ce8c41fa.json @@ -1,17 +1,34 @@ { "id": "c56de254-a3ec-414e-81a6-83d2ce8c41fa", "snapshot": "os", - "instruction": "Could you please help me to extract text from a non-indexed PDF document on the current system?", + "instruction": "I want to install the lxml package on my ubuntu system. Can you help me?", "source": "https://superuser.com/questions/28426/how-to-extract-text-with-ocr-from-a-pdf-on-linux", + "config": [ + { + "type": "execute", + "parameters": { + "command": "sudo apt-get update && sudo apt-get install -y python3", + "shell": true + } + } + ], "trajectory": "trajectories/", "related_apps": [ "os" ], "evaluator": { - "func": "", + "func": "exact_match", "result": { + "type": "vm_command_line", + "command": "python3 -c \"import lxml\" >/dev/null 2>&1 && echo \"lxml is installed\" || echo \"lxml is not installed\"", + "shell": true }, "expected": { + "type": "rule", + "rules":{ + "expected": "lxml is installed" + } } } - } \ No newline at end of file + } + \ No newline at end of file diff --git a/evaluation_examples/examples/os/cc9d4f34-1ca0-4a1b-8ff2-09302696acb9.json b/evaluation_examples/examples/os/cc9d4f34-1ca0-4a1b-8ff2-09302696acb9.json index b8d4d30..f1ff95a 100644 --- a/evaluation_examples/examples/os/cc9d4f34-1ca0-4a1b-8ff2-09302696acb9.json +++ b/evaluation_examples/examples/os/cc9d4f34-1ca0-4a1b-8ff2-09302696acb9.json @@ -1,17 +1,33 @@ { "id": "cc9d4f34-1ca0-4a1b-8ff2-09302696acb9", "snapshot": "os", - "instruction": "I need you to execute a specific process or script from the terminal and ensure that it continues to run independently, even after the terminal session is terminated. This involves redirecting the process's output to a file and disassociating the process from the terminal session's control.", - "source": "https://superuser.com/questions/178587/how-do-i-detach-a-process-from-terminal-entirely", + "instruction": "Currently, the program my_process.sh is running in the system and I want to end the process. Can you help me?", + "source": "https://stackoverflow.com/questions/9346211/how-to-kill-a-process-on-a-port-on-ubuntu", + "config": [ + { + "type": "execute", + "parameters": { + "command": "echo -e '#!/bin/bash\n\nwhile true; do\necho \"Running my_process...\"\nsleep 1\ndone' > my_process.sh && chmod +x my_process.sh && nohup ./my_process.sh > /dev/null 2>&1 &", + "shell": true + } + } + ], "trajectory": "trajectories/", "related_apps": [ "os" ], "evaluator": { - "func": "", + "func": "exact_match", "result": { + "type": "vm_command_line", + "command": "[[ -z $(ps -ef | grep -v grep | grep my_process) ]] && echo \"Process killed\" || echo \"Process still running\"", + "shell": true }, "expected": { + "type": "rule", + "rules":{ + "expected": "Process killed" + } } } } \ No newline at end of file