Spaces:
Running
Running
Update rag_engine.py
Browse files- rag_engine.py +2 -0
rag_engine.py
CHANGED
|
@@ -6,6 +6,7 @@ from clare_core import (
|
|
| 6 |
get_embedding,
|
| 7 |
cosine_similarity,
|
| 8 |
)
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
def build_rag_chunks_from_file(file, doc_type_val: str) -> List[Dict]:
|
|
@@ -45,6 +46,7 @@ def build_rag_chunks_from_file(file, doc_type_val: str) -> List[Dict]:
|
|
| 45 |
return []
|
| 46 |
|
| 47 |
|
|
|
|
| 48 |
def retrieve_relevant_chunks(
|
| 49 |
question: str,
|
| 50 |
rag_chunks: List[Dict],
|
|
|
|
| 6 |
get_embedding,
|
| 7 |
cosine_similarity,
|
| 8 |
)
|
| 9 |
+
from langsmith import traceable
|
| 10 |
|
| 11 |
|
| 12 |
def build_rag_chunks_from_file(file, doc_type_val: str) -> List[Dict]:
|
|
|
|
| 46 |
return []
|
| 47 |
|
| 48 |
|
| 49 |
+
@traceable(run_type="retriever", name="retrieve_relevant_chunks")
|
| 50 |
def retrieve_relevant_chunks(
|
| 51 |
question: str,
|
| 52 |
rag_chunks: List[Dict],
|