Skip to content

Commit 7e7b286

Browse files
committed
unicorn mode
1 parent 37137a5 commit 7e7b286

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ scripts/ctx.py "add error handling" --unicorn --language python
249249

250250
**How it works:**
251251

252+
<p align="center">
253+
<img src="enhance.png" alt="Unicorn Usage" width="50%"/>
254+
</p>
255+
252256
Unicorn mode uses multiple LLM passes with progressively richer code context:
253257

254258
1. **Pass 1 (Draft)**: Retrieves rich code snippets (8 lines of context per match) to understand the codebase and sharpen the intent

enhance.png

238 KB
Loading

scripts/ctx.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -712,13 +712,7 @@ def enhance_unicorn(query: str, **filters) -> str:
712712
else:
713713
output = final
714714

715-
# Stream the final output
716-
import sys
717-
sys.stdout.write(output)
718-
sys.stdout.write("\n")
719-
sys.stdout.flush()
720-
721-
# Sanitize citations on the final output
715+
# Sanitize citations on the final output and return
722716
allowed_paths2, _ = extract_allowed_citations(ctx2)
723717
return sanitize_citations(output.strip(), allowed_paths1.union(allowed_paths2))
724718

0 commit comments

Comments
 (0)