Quincy Hsieh commited on
Commit
dc06bcc
·
1 Parent(s): 312a42b

Add ref_text to the referenced text of the source file

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -367,7 +367,7 @@ def rag_query(query: str, top_k: int = TOP_K_RESULTS) -> dict:
367
  # Step 4: Return structured response
368
  return {
369
  "answer": answer,
370
- "sources": [{"source": ctx["source"], "score": ctx["similarity_score"]} for ctx in contexts],
371
  "explanation": explanation,
372
  "total_token": total_token,
373
  "run_time_in_ms": elapsed_ms,
 
367
  # Step 4: Return structured response
368
  return {
369
  "answer": answer,
370
+ "sources": [{"source": ctx["source"], "score": ctx["similarity_score"], "ref_text": ctx["text"]} for ctx in contexts],
371
  "explanation": explanation,
372
  "total_token": total_token,
373
  "run_time_in_ms": elapsed_ms,