osanseviero
commited on
Commit
•
c7cbd58
1
Parent(s):
1daaa44
Upload prompts/LLM_Bash_Prompt with huggingface_hub
Browse files
prompts/LLM_Bash_Prompt/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
---
|
3 |
+
tags:
|
4 |
+
- langchain
|
5 |
+
- prompt
|
6 |
+
---
|
7 |
+
|
8 |
+
# Description of LLM Bash Prompt
|
9 |
+
|
10 |
+
Prompt designed to convert natural language to bash command.
|
11 |
+
|
12 |
+
## Inputs
|
13 |
+
|
14 |
+
This is a description of the inputs that the prompt expects.
|
15 |
+
|
16 |
+
question: User question to be answered by writing a bash command.
|
17 |
+
|
18 |
+
|
19 |
+
## Usage
|
20 |
+
|
21 |
+
Below is a code snippet for how to use the prompt.
|
22 |
+
|
23 |
+
```
|
24 |
+
from langchain.prompts import load_prompt
|
25 |
+
from langchain.chains import LLMBashChain
|
26 |
+
|
27 |
+
llm = ...
|
28 |
+
prompt = load_prompt('lc://prompts/llm_bash/<file-name>')
|
29 |
+
chain = LLMBashChain(llm=llm, prompt=prompt)
|
30 |
+
```
|
31 |
+
|
prompts/LLM_Bash_Prompt/prompt.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"input_variables": ["question"], "output_parser": null, "template": "If someone asks you to perform a task, your job is to come up with a series of bash commands that will perform the task. There is no need to put \\\"#!/bin/bash\\\" in your answer. Make sure to reason step by step, using this format:\\n\\nQuestion: \\\"copy the files in the directory named 'target' into a new directory at the same level as target called 'myNewDirectory'\\\"\\n\\nI need to take the following actions:\\n- List all files in the directory\\n- Create a new directory\\n- Copy the files from the first directory into the second directory\\n```bash\\nls\\nmkdir myNewDirectory\\ncp -r target/* myNewDirectory\\n```\\n\\nThat is the format. Begin!\\n\\nQuestion: {question}", "template_format": "f-string"}
|