Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/code_qna/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from rich.panel import Panel
from rich.table import Table
from rich.tree import Tree
from rich.markup import escape
import time

from .context import ContextExtractor
Expand Down Expand Up @@ -133,7 +134,7 @@ def main(question, path, model, api_key, interactive, stream, max_context, debug

def process_question(question, context_extractor, gemini, stream=False, debug=False, chat_session=None, show_progress=True):
"""Process a single question."""
console.print(f"\n[bold]Question:[/bold] {question}")
console.print(f"\n[bold]Question:[/bold] {escape(question)}")

# Extract context
if not show_progress:
Expand All @@ -160,7 +161,7 @@ def process_question(question, context_extractor, gemini, stream=False, debug=Fa
if not show_progress: # Only show basic timing if detailed progress was disabled
console.print(f"\n[dim]Extraction time: {extract_time:.2f}s[/dim]")

console.print(f"[dim]Keywords: {', '.join(context['keywords'])}[/dim]")
console.print(f"[dim]Keywords: {escape(', '.join(context['keywords']))}[/dim]")
console.print(f"[dim]Files found: {context['context_files']['total_files']}[/dim]")
console.print(f"[dim]Context size: {context['context_files']['total_size']:,} chars[/dim]")

Expand Down Expand Up @@ -201,7 +202,7 @@ def process_question(question, context_extractor, gemini, stream=False, debug=Fa
generator = gemini.generate_answer_stream(question, context)

for chunk in generator:
console.print(chunk, end="")
console.print(chunk, end="", markup=False, highlight=False)
response_parts.append(chunk)

console.print() # New line after streaming
Expand Down