add response highlight

This commit is contained in:
yichuan520030910320
2025-08-03 20:32:07 -07:00
parent 31fd3c816a
commit 7ad2ec39d6
3 changed files with 5 additions and 4 deletions

View File

@@ -216,7 +216,7 @@ Ask questions directly about your personal PDFs, documents, and any directory co
<img src="videos/paper_clear.gif" alt="LEANN Document Search Demo" width="600"> <img src="videos/paper_clear.gif" alt="LEANN Document Search Demo" width="600">
</p> </p>
The example below asks a question about summarizing our paper (uses default data in `examples/data`, which is a directory with diverse data sources: two papers, Pride and Prejudice, and a README in Chinese) and this is the easiest example to run here: The example below asks a question about summarizing our paper (uses default data in `examples/data`, which is a directory with diverse data sources: two papers, Pride and Prejudice, and a README in Chinese) and this is the **easiest example** to run here:
```bash ```bash
source .venv/bin/activate # Don't forget to activate the virtual environment source .venv/bin/activate # Don't forget to activate the virtual environment

View File

@@ -246,9 +246,9 @@ class BaseRAGExample(ABC):
complexity=args.search_complexity, complexity=args.search_complexity,
) )
print(f"\n[Query] {query}") print(f"\n[Query]: \033[36m{query}\033[0m")
response = chat.ask(query, top_k=args.top_k, complexity=args.search_complexity) response = chat.ask(query, top_k=args.top_k, complexity=args.search_complexity)
print(f"\n[Response] {response}\n") print(f"\n[Response]: \033[36m{response}\033[0m")
async def run(self): async def run(self):
"""Main entry point for the example.""" """Main entry point for the example."""
@@ -268,6 +268,7 @@ class BaseRAGExample(ABC):
return return
index_path = await self.build_index(args, texts) index_path = await self.build_index(args, texts)
print(f"Index saved to: {index_path}")
else: else:
print(f"\nUsing existing index: {index_path}") print(f"\nUsing existing index: {index_path}")