add reuse code

This commit is contained in:
yichuan520030910320 committed 2025-07-07 21:07:00 +00:00
1 parent 95a653993a
commit 6fc57eb48e
4 files changed
+25 -1

No files matched your search

+6 -1
View File
@@ -217,7 +217,12 @@ class LeannChat:
results = self.searcher.search(question, top_k=top_k, **kwargs)
context = "\n\n".join([r.text for r in results])
prompt = f"Context:\n{context}\n\nQuestion: {question}\n\nAnswer:"
prompt = (
"Here is some retrieved context that might help answer your question:\n\n"
f"{context}\n\n"
f"Question: {question}\n\n"
"Please provide the best answer you can based on this context and your knowledge."
)
print(f"DEBUG: Calling LLM with prompt: {prompt}...")
try:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.