Post AWufUD63OGJTVEISDw by yoz@mastodon.social
(DIR) More posts by yoz@mastodon.social
(DIR) Post #AWpU5kAZDdV5YBjsYa by simon@fedi.simonwillison.net
2023-06-18T22:15:50Z
0 likes, 0 repeats
I just released symbex, a tiny Python CLI tool for recursively searching for functions and classes by name or wildcardIt's mainly useful for finding code to pipe to my LLM tool for command-line code explanations and refactoringhttps://simonwillison.net/2023/Jun/18/symbex/
(DIR) Post #AWpUa8LhsrqpEJRNU8 by simon@fedi.simonwillison.net
2023-06-18T22:21:19Z
0 likes, 0 repeats
Being able to pipe code to an LLM in the terminal is really fun`symbex Request | llm --system 'add type hints to this'`
(DIR) Post #AWpUpljdjJl3j95fou by simon@fedi.simonwillison.net
2023-06-18T22:23:53Z
0 likes, 0 repeats
The hardest part of this project was picking a name for it!I ended up using ChatGPT Browse, since it could both read the README and then check ideas for names on PyPI to see if they were taken or nothttps://til.simonwillison.net/gpt3/picking-python-project-name-chatgpt
(DIR) Post #AWpZsBEWOoBJ9rVKXw by tintvrtkovic@mastodon.social
2023-06-18T23:20:17Z
0 likes, 0 repeats
@simon That's actually very cool. Also bad for me, since the difficulty of naming new projects is what's made me have a manageable number of projects so far.
(DIR) Post #AWpb1jdNxxrcPZFpAm by kellogh@hachyderm.io
2023-06-18T23:33:27Z
0 likes, 0 repeats
@simon you could use tree sitter to do this for a lot more languages
(DIR) Post #AWq5lY22QuBiNBXxJo by simon@fedi.simonwillison.net
2023-06-19T05:17:30Z
0 likes, 0 repeats
@garthk that's the next feature I have planned for LLM - the ability to swap in alternative models via plugins, including locally hosted ones https://github.com/simonw/llm/issues/53
(DIR) Post #AWqL7KONKAlTklq1mC by simon@fedi.simonwillison.net
2023-06-19T08:09:53Z
0 likes, 0 repeats
symbex 0.2.1 is out with a couple of minor bug fixes https://github.com/simonw/symbex/releases/tag/0.2.1
(DIR) Post #AWqt4EIguhPYQusEPg by simon@fedi.simonwillison.net
2023-06-19T14:30:10Z
0 likes, 0 repeats
I released symbex 0.3 with a couple of neat new featuressymbex 'test_*' --signatures (or -s) will display just matching signatures, not the whole bodysymbex 'MyClass.method' can be used to find specific methods - or use wildcards like '*.get_*'https://github.com/simonw/symbex/releases/tag/0.3
(DIR) Post #AWrChqQiyrrX73Ebqq by simon@fedi.simonwillison.net
2023-06-19T18:10:10Z
0 likes, 0 repeats
OK, tearing myself away from this project now.0.4 fixes a bunch of issues - I can now run "symbex -d --signatures ~/Dev" and it processes over 300,000 function and class definitions in 2m30s without any errors (that's a whole lot of virtual environments) https://github.com/simonw/symbex/releases/tag/0.4
(DIR) Post #AWsjWvg4caRbqcmDya by simon@fedi.simonwillison.net
2023-06-20T11:52:11Z
0 likes, 0 repeats
symbex 0.5 adds a --count option and a bunch of filters, including ways to filter for functions based on the presence or absence of type annotations.For example, this will give you a count of the number of async functions with type annotations:symbex --async --typed --counthttps://github.com/simonw/symbex/releases/tag/0.5
(DIR) Post #AWtEY4ILAJoJRThOS0 by austegard@mastodon.social
2023-06-20T17:40:05Z
0 likes, 0 repeats
@simon This is looking quite promising. One use case: I would love to use an LLM to interrogate our private codebase but so far Legal is against it -- considers it too much of an IP risk. I *believe* if rather than submitting actual code we submitted the structure and comments of the code to the LLM we could classify that "scaffolding" as non-IP and thus make use of the LLM. Is that a use case worthy of including as an option in symbex?
(DIR) Post #AWtJD39ehzpbb0Qwuu by simon@fedi.simonwillison.net
2023-06-20T18:32:32Z
0 likes, 0 repeats
@austegard that's a really interesting idea, submitting code that's just function signatures and docstrings and commentsI'm adding local LLM support shortly, at which point you could use things like the Replit code model or StarCoder running on tour own machine
(DIR) Post #AWtZMaiOtqO1YRFzWK by austegard@mastodon.social
2023-06-20T21:33:18Z
0 likes, 0 repeats
@simon After some brainstorming with GPT-4 I changed the format of the JSON output to both be more concise and more suitable for embeddingSee https://gist.github.com/oaustegard/4e4539fd1c9b4bc40fce4c30bb8703a2#file-improved_document_file_meta-jsonand for a more complex example (chosen by GPT-4...), the baked-in collections package: https://gist.github.com/oaustegard/4e4539fd1c9b4bc40fce4c30bb8703a2#file-built_in_collections_package_doc-json
(DIR) Post #AWtfM1DTU04rBKty2i by simon@fedi.simonwillison.net
2023-06-20T22:40:44Z
0 likes, 0 repeats
symbex 0.6 adds a new `--docstrings` option for showing just function/class signatures along with their docstrings, plus `--documented` and `--undocumented` filters for showing only classes and functions that have docstrings or are lacking docstrings, respectivelyhttps://github.com/simonw/symbex/releases/tag/0.6
(DIR) Post #AWubxiXz8aGVcsAySu by simon@fedi.simonwillison.net
2023-06-21T09:37:19Z
0 likes, 0 repeats
My llm, ttok, strip-tags and symbex tools can now all be installed using Homebrew - details here: https://github.com/simonw/homebrew-llm
(DIR) Post #AWucOkABEl4cSNvd32 by simon@fedi.simonwillison.net
2023-06-21T09:42:17Z
0 likes, 0 repeats
Here's my TIL about setting up a GitHub Actions workflow that can automatically generate updated Homebrew formulas for updated versions of tools released as Python packages https://til.simonwillison.net/homebrew/auto-formulas-github-actions
(DIR) Post #AWucgiaxo0Puo31kSO by Conornash@mastodon.social
2023-06-21T09:45:33Z
0 likes, 0 repeats
@simon Installing right now! Only learned of `llm` yesterday so this is perfect timing 😄
(DIR) Post #AWufUD63OGJTVEISDw by yoz@mastodon.social
2023-06-21T10:17:01Z
0 likes, 0 repeats
@simon so much for “tearing myself away from this project now”YOU WOULDN’T LET IT LIE
(DIR) Post #AWyEttDlyuTO2biKES by simon@fedi.simonwillison.net
2023-06-23T03:37:45Z
0 likes, 0 repeats
symbex 0.7 adds a whole host of extra features for more easily searching code in the Python standard library (using --stdlib) or in importable packages, using options like "-m pathlib" or "-m httpx"https://github.com/simonw/symbex/releases/tag/0.7
(DIR) Post #AXYbBRUL6sSlHFoD7Q by austegard@mastodon.social
2023-07-10T16:36:16Z
0 likes, 0 repeats
@simon Have you seen this approach: using ctags? https://aider.chat/docs/ctags.html
(DIR) Post #AXZE997ELR4FvctawS by simon@fedi.simonwillison.net
2023-07-10T23:52:13Z
0 likes, 0 repeats
@austegard I hadn't, that's a really neat trick