Spaces:
Paused
Paused
| from langchain_community.retrievers import BM25Retriever | |
| from langchain.tools import Tool | |
| def extract_text(query: str) -> str: | |
| """Retrieves detailed information about gala guests based on their name or relation.""" | |
| results = bm25_retriever.invoke(query) | |
| if results: | |
| return "\n\n".join([doc.page_content for doc in results[:3]]) | |
| else: | |
| return "No matching guest information found." | |