└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # llm-prompts 2 | 3 | A collection of prompts for use with the LLM CLI tool 4 | 5 | Relevant: 6 | 7 | - [LLM documentation](https://llm.datasette.io/) 8 | - [llm, ttok and strip-tags—CLI tools for working with ChatGPT and other LLMs](https://simonwillison.net/2023/May/18/cli-tools-for-llms/) 9 | - [symbex: search Python code for functions and classes, then pipe them into a LLM](https://simonwillison.net/2023/Jun/18/symbex/) 10 | 11 | Many of these are "system prompts" - where content is piped to the tool along with a `--system prompt` that tells the tool how it should process that data. 12 | 13 | ## Using symbex 14 | 15 | [symbex](https://github.com/simonw/symbex) is a CLI tool for searching for and outputting subsets of Python code based on search criteria. The tool is designed to help extract content for passing to `llm`. 16 | 17 | ## Features derived from tests 18 | 19 | > Detailed bullet point list of features of this software 20 | 21 | Running this in a fresh checkout of [simonw/symbex](https://github.com/simonw/symbex) with `3.5-16k` - the 3.5 turbo model with a 16,000 token context: 22 | 23 | ```bash 24 | symbex 'test_*' | llm --system 'Detailed bullet point list of features of this software' -m 3.5-16k 25 | ``` 26 | Output: 27 | 28 | > Features of this software include: 29 | > 30 | > 1. Testing of command-line interface to ensure it shows help when no arguments are provided. 31 | > 2. Testing of command-line interface to ensure it returns the expected output for different argument combinations. 32 | > 3. Testing of command-line interface to ensure it shows errors when necessary. 33 | > 4. Testing of reading a file with a specific encoding to ensure correct text is read. 34 | > 5. Testing of formatting quoted strings to ensure they are properly escaped and formatted. 35 | > 6. Testing of symbol extraction to ensure correct symbols are identified from the given code. 36 | > 7. Testing of method symbols to ensure correct methods are identified from the given code. 37 | > 8. Testing of retrieving symbols with documented and undocumented filters to ensure correct symbols are returned. 38 | > 9. Testing of filtering symbols based on various options such as function, class, async, typed, untyped, partially-typed, fully-typed, documented, and undocumented. 39 | > 10. Testing of counting the number of symbols returned by the filters. 40 | 41 | The "Testing of" bits there indicate it didn't fully understand the idea of describing the software, not the tests. 42 | 43 | GPT-4 handled this much better: 44 | 45 | ```bash 46 | symbex 'test_*' | llm --system 'Detailed bullet point list of features of this software' -m 4 47 | ``` 48 | > - Search for symbols (functions, classes, etc.) in a given codebase 49 | > - Show detailed information on the selected symbol (e.g. function signature) 50 | > - Filter symbols based on various criteria such as: 51 | > - Function 52 | > - Class 53 | > - Async 54 | > - Typed 55 | > - Partially typed 56 | > - Fully typed 57 | > - Documented 58 | > - Undocumented 59 | > - Support file and directory filtering 60 | > - Handle different Python versions and file encodings 61 | > - Include tests for functionality and CLI behavior 62 | > - Quoted string support for single and multiline strings 63 | > - Count the number of matching symbols 64 | > - CLI Runner to execute command line interface tests 65 | > - Parametrized testing for multiple input-output combinations 66 | > - Display line numbers for symbol, classes, methods, etc. 67 | 68 | --------------------------------------------------------------------------------