From 6e4a65579c3ade76feea0890072099f0d0caf416 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Mon, 28 Aug 2023 21:05:25 -0400 Subject: Prototype Mynion This implements a prototype Mynion, my chatbot which will eventually help me write code here. In fact he's already helping me, and works pretty well over xmpp. The prompt is currently not checked in because I'm experimenting with it a lot, and it should probably be a runtime parameter anyways. In the course of writing this I added some helper libraries to get me going, configured black (didn't even know that was possible), and added 'outlines' and its dependencies even though I didn't end up using it. I'll keep outlines around for now, but I'm not sure how useful it really is because afaict its just pre-defining some stop conditions. But it took a while to get it working so I'll just keep it in for now. --- Biz/Ide/repl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Biz/Ide/repl') diff --git a/Biz/Ide/repl b/Biz/Ide/repl index 1d94e47..1401218 100755 --- a/Biz/Ide/repl +++ b/Biz/Ide/repl @@ -30,6 +30,7 @@ fi sysdeps=$(jq --raw-output '.[].sysdeps | join(" ")' <<< $json) exts=$(jq --raw-output '.[].namespace.ext' <<< $json | sort | uniq) packageSet=$(jq --raw-output '.[].packageSet' <<< $json) + module=$(jq --raw-output '.[].mainModule' <<< $json) BILD="(import ${BIZ_ROOT:?}/Biz/Bild.nix {})" for lib in ${sysdeps[@]}; do flags+=(--packages "$BILD.pkgs.${lib}") @@ -64,8 +65,11 @@ fi ;; Py) langdeps="$langdeps mypy" + flags+=(--packages ruff) flags+=(--packages "$BILD.bild.python.pythonWith (p: with p; [$langdeps])") - command=${CMD:-"python -i $targets"} + PYTHONPATH=$BIZ_ROOT:$PYTHONPATH + pycommand="python -i $BIZ_ROOT/Biz/Repl.py $module ${targets[@]}" + command=${CMD:-"$pycommand"} ;; *) echo "unsupported targets: ${targets[@]}" -- cgit v1.2.3