diff --git a/ape_linux.py b/ape_linux.py index fc0adcf..57848d2 100644 --- a/ape_linux.py +++ b/ape_linux.py @@ -31,6 +31,7 @@ def call_llm( {"role": "system", "content": system_prompt}, {"role": "user", "content": user_prompt}, ], + temperature=0.2, ) .choices[0] .message.content @@ -81,11 +82,25 @@ def main( system_prompt = """\ You are a Linux command assistant. You will be asked a question about how to perform a task in Linux or Unix-like operating systems. You should only include in your answer the command or commands to perform the task. If you do not know how to perform the task, output "echo "Please try again."". + It is important that you do not output commands enclosed in ``` ``` Markdown blocks. For example, do not output: + + ```sh + cd projects + ls + ``` + + Instead, your output should be a command that is to be entered directly into the command line. For the example above this is: cd projects && ls + + You are also allowed to use \\ for command continuation. + Here are a few examples. Question: List all the files and directories in projects in my home directory Answer: ls ~/projects + Question: Navigate to projects and list its contents + Answer: cd projects && ls + Question: What is my username? Answer: whoami @@ -96,19 +111,7 @@ def main( Answer: echo "Please try again." Question: Tell me a story - Answer: echo "Please try again. - - It is important that you do not output commands enclosed in ``` ``` Markdown blocks. For example, - - ```sh - cd projects - ls - ``` - - is not allowed. Instead, your output should be a command that is to be entered directly into the command line. For the example above: cd projects && ls - - You are also allowed to use \\ for command continuation. - \"""" # noqa: E501 + Answer: echo "Please try again.\"""" # noqa: E501 user_prompt = f"""\ Question: {query.strip()} diff --git a/pyproject.toml b/pyproject.toml index 6259238..cc0a154 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ape-linux" -version = "0.3.3" +version = "0.3.4" description = "AI for Linux commands" readme = "README.md" license = {text = "MIT License"} diff --git a/uv.lock b/uv.lock index 29730db..eb131dd 100644 --- a/uv.lock +++ b/uv.lock @@ -28,7 +28,7 @@ wheels = [ [[package]] name = "ape-linux" -version = "0.3.1" +version = "0.3.3" source = { editable = "." } dependencies = [ { name = "openai" },