Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -161,7 +161,7 @@ def retrieve_documents(query: str):
|
|
| 161 |
query (str): The current user query.
|
| 162 |
|
| 163 |
Returns:
|
| 164 |
-
Dict: The retrieved response.
|
| 165 |
"""
|
| 166 |
retrieved_documents = []
|
| 167 |
retrieved_documents = structured_retriever.invoke("Fetch at most 10 documents"+str(query))
|
|
@@ -202,6 +202,7 @@ def expand_and_retrieve(query, llm, structured_retriever):
|
|
| 202 |
|
| 203 |
|
| 204 |
class CustomRetriever(BaseRetriever):
|
|
|
|
| 205 |
"""A custom retriever that contains the top k documents that contain the user query.
|
| 206 |
This retriever only implements the sync method _get_relevant_documents.
|
| 207 |
"""
|
|
@@ -222,9 +223,9 @@ def agentic_rag(query: str):
|
|
| 222 |
|
| 223 |
Args:
|
| 224 |
query (str): The current user query.
|
| 225 |
-
|
| 226 |
Returns:
|
| 227 |
-
Dict: The retrieved response.
|
| 228 |
"""
|
| 229 |
# Initialize state with necessary parameters
|
| 230 |
inputs = {
|
|
|
|
| 161 |
query (str): The current user query.
|
| 162 |
|
| 163 |
Returns:
|
| 164 |
+
Dict (str): The retrieved response.
|
| 165 |
"""
|
| 166 |
retrieved_documents = []
|
| 167 |
retrieved_documents = structured_retriever.invoke("Fetch at most 10 documents"+str(query))
|
|
|
|
| 202 |
|
| 203 |
|
| 204 |
class CustomRetriever(BaseRetriever):
|
| 205 |
+
|
| 206 |
"""A custom retriever that contains the top k documents that contain the user query.
|
| 207 |
This retriever only implements the sync method _get_relevant_documents.
|
| 208 |
"""
|
|
|
|
| 223 |
|
| 224 |
Args:
|
| 225 |
query (str): The current user query.
|
| 226 |
+
context_list (List[Dict[str, Any]): The list of retrieved documents.
|
| 227 |
Returns:
|
| 228 |
+
Dict (str): The retrieved response.
|
| 229 |
"""
|
| 230 |
# Initialize state with necessary parameters
|
| 231 |
inputs = {
|