feat: AI-assisted compilation and code generation

- New src/ai_assist.nim module with DeepSeek/OpenAI/MiMo API support
- AI explains compiler errors automatically when compilation fails
- New CLI command: cljnim ai '<description>' for code generation
- REPL :ai command for interactive AI assistance
- API keys read from environment vars (DEEPSEEK_API_KEY, OPENAI_API_KEY, MIMO_API_KEY)
- Tests for prompt building and response formatting
- Updated README with AI integration docs
This commit is contained in:
2026-05-08 22:21:27 +03:00
parent 6bed638300
commit 6249d8a251
7 changed files with 382 additions and 32 deletions
+16 -2
View File
@@ -1,9 +1,9 @@
.PHONY: build test clean run-example bench bench-aot
.PHONY: build test check clean run-example bench bench-aot
NIMCACHE = nimcache
build:
nim c -o:cljnim src/cljnim.nim
nim c -d:ssl -o:cljnim src/cljnim.nim
test:
nim c -r tests/test_reader.nim
@@ -11,7 +11,9 @@ test:
nim c -r tests/test_pvec.nim
nim c -r tests/test_pmap.nim
nim c -r tests/test_deps.nim
nim c -r tests/test_macros.nim
nim c -r tests/test_eval.nim
nim c --path:src -r tests/test_ai_assist.nim
test-reader:
nim c -r tests/test_reader.nim
@@ -19,6 +21,13 @@ test-reader:
test-emitter:
nim c -r tests/test_emitter.nim
check: build test
./cljnim run examples/hello.clj
./cljnim run examples/math.clj
./cljnim run examples/core.clj
./cljnim run examples/interop.clj
./cljnim run examples/macros.clj
run-example: build
./cljnim run examples/hello.clj
@@ -36,3 +45,8 @@ clean:
find . -name "test_reader" -delete
find . -name "test_emitter" -delete
find . -name "test_deps" -delete
find . -name "test_pvec" -delete
find . -name "test_pmap" -delete
find . -name "test_eval" -delete
find . -name "test_macros" -delete
find . -name "test_ai_assist" -delete