Spaces:
Sleeping
Sleeping
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -5,18 +5,3 @@ from langchain_community.tools import DuckDuckGoSearchRun
|
|
| 5 |
|
| 6 |
search_tool = DuckDuckGoSearchRun()
|
| 7 |
|
| 8 |
-
bm25_retriever = BM25Retriever.from_documents(docs)
|
| 9 |
-
|
| 10 |
-
def extract_text(query: str) -> str:
|
| 11 |
-
"""Retrieves detailed information about gala guests based on their name or relation."""
|
| 12 |
-
results = bm25_retriever.invoke(query)
|
| 13 |
-
if results:
|
| 14 |
-
return "\n\n".join([doc.page_content for doc in results[:3]])
|
| 15 |
-
else:
|
| 16 |
-
return "No matching guest information found."
|
| 17 |
-
|
| 18 |
-
guest_info_tool = Tool(
|
| 19 |
-
name="guest_info_retriever",
|
| 20 |
-
func=extract_text,
|
| 21 |
-
description="Retrieves detailed information about gala guests based on their name or relation."
|
| 22 |
-
)
|
|
|
|
| 5 |
|
| 6 |
search_tool = DuckDuckGoSearchRun()
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|