|
| 1 | +- Run some prompts checked in to GitHub against a project in the current working directory. |
| 2 | + id:: 66d779c7-c1b7-40c6-a635-fa712da492de |
| 3 | + ```sh |
| 4 | + docker run |
| 5 | + --rm -it \ |
| 6 | + --pull=always \ |
| 7 | + -v /var/run/docker.sock:/var/run/docker.sock \ |
| 8 | + -v /run/host-services/backend.sock:/host-services/docker-desktop-backend.sock \ |
| 9 | + -e "DOCKER_DESKTOP_SOCKET_PATH=/host-services/docker-desktop-backend.sock" \ |
| 10 | + --mount type=volume,source=docker-prompts,target=/prompts \ |
| 11 | + -e "OPENAI_API_KEY_LOCATION=/root" \ |
| 12 | + --mount type=bind,source=$HOME/.openai-api-key,target=/root/.openai-api-key \ |
| 13 | + vonwig/prompts:latest \ |
| 14 | + run \ |
| 15 | + --host-dir $PWD \ |
| 16 | + --platform $(uname -o) \ |
| 17 | + --prompts "github:docker/labs-make-runbook?ref=main&path=prompts/lazy_docker" |
| 18 | + ``` |
| 19 | + - Most of this is boiler plate except: |
| 20 | + - the `--user` option in line 10 requires a valid DOCKER_HUB user name |
| 21 | + - the `--prompts` option in line 12 requires a valid [github reference]([[GitHub Refs]]) to some markdown prompts |
| 22 | + - if the project is located somewhere other than $PWD then the `--host-dir` will need to be updated. |
| 23 | +- Run a local prompt markdown file against a project in the current working directory. In this example, the prompts are not pulled from GitHub. Instead, our prompts are being developed in a directory called `$PROMPTS_DIR`. In this example, the local prompt file is `$PROMPTS_DIR/myprompts.md`. |
| 24 | + id:: 66d77f1b-1684-480d-ad7b-5e9f53292fe4 |
| 25 | + ```sh |
| 26 | + docker run |
| 27 | + --rm -it \ |
| 28 | + --pull=always \ |
| 29 | + -v /var/run/docker.sock:/var/run/docker.sock \ |
| 30 | + -v /run/host-services/backend.sock:/host-services/docker-desktop-backend.sock \ |
| 31 | + -e "DOCKER_DESKTOP_SOCKET_PATH=/host-services/docker-desktop-backend.sock" \ |
| 32 | + --mount type=volume,source=docker-prompts,target=/prompts \ |
| 33 | + -e "OPENAI_API_KEY_LOCATION=/root" \ |
| 34 | + --mount type=bind,source=$HOME/.openai-api-key,target=/root/.openai-api-key \ |
| 35 | + --mount type=bind,source=$PROMPTS_DIR,target=/app/workdir \ |
| 36 | + --workdir /app/workdir \ |
| 37 | + vonwig/prompts:latest \ |
| 38 | + run \ |
| 39 | + --host-dir $PWD \ |
| 40 | + --platform $(uname -o) \ |
| 41 | + --prompts-file myprompts.md |
| 42 | + ``` |
| 43 | + - Most of this is boiler plate except: |
| 44 | + - the `--user` option in line 12 requires a valid DOCKER_HUB user name |
| 45 | + - the `--prompts-file` option in line 14 is a relative path to a prompts file (relative to $PROMPTS_DIR) |
| 46 | + - if the project being analyzed is located somewhere other than $PWD then the `--host-dir` will need to be updated. |
| 47 | +- [[Running the Prompt Engine]] |
| 48 | +- [[Authoring Prompts]] |
| 49 | +- id:: 66d7f3ff-8769-40b3-b6b5-fc4fceea879e |
| 50 | + ``` |
| 51 | + --- |
| 52 | + extractors: |
| 53 | + - name: linguist |
| 54 | + image: vonwig/go-linguist:latest |
| 55 | + command: |
| 56 | + - -json |
| 57 | + output-handler: linguist |
| 58 | + tools: |
| 59 | + - name: findutils-by-name |
| 60 | + description: find files in a project by name |
| 61 | + parameters: |
| 62 | + type: object |
| 63 | + properties: |
| 64 | + glob: |
| 65 | + type: string |
| 66 | + description: the glob pattern for files that should be found |
| 67 | + container: |
| 68 | + image: vonwig/findutils:latest |
| 69 | + command: |
| 70 | + - find |
| 71 | + - . |
| 72 | + - -name |
| 73 | + model: llama3.1 |
| 74 | + url: http://localhost/v1/chat/completions |
| 75 | + stream: false |
| 76 | + --- |
| 77 | + |
| 78 | + # Prompt system |
| 79 | + |
| 80 | + You are an expert on analyzing project content. |
| 81 | + |
| 82 | + # Prompt user |
| 83 | + |
| 84 | + {{#linguist}} |
| 85 | + This project contains {{language}} code. |
| 86 | + {{/linguist}} |
| 87 | + |
| 88 | + Can you find any language specific project files and list them? |
| 89 | + ``` |
0 commit comments