Spaces:
Sleeping
Sleeping
Download rag/tools/__init__.py from Hamdy005/Study-Buddy: direct link, hf CLI and curl.
- Browser
- Download file 769 Bytes
-
https://huggingface.co/spaces/Hamdy005/Study-Buddy/resolve/main/rag/tools/__init__.py
- Command line
-
hf download hf://spaces/Hamdy005/Study-Buddy/rag/tools/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/Hamdy005/Study-Buddy/resolve/main/rag/tools/__init__.py
769 Bytes
| """ | |
| Retriever tools registry and exports for CRAG inside src/rag. | |
| """ | |
| from typing import Any, Awaitable, Callable | |
| from src.rag.schemas import Source | |
| from src.rag.tools.supabase import retrieve_supabase | |
| from src.rag.tools.wikipedia import retrieve_wikipedia | |
| from src.rag.tools.arxiv import retrieve_arxiv | |
| from src.rag.tools.web import retrieve_web | |
| # Type for retriever function | |
| RetrieverFn = Callable[[str, int], Awaitable[list[dict[str, Any]]]] | |
| TOOL_REGISTRY: dict[Source, RetrieverFn] = { | |
| "supabase": retrieve_supabase, | |
| "wikipedia": retrieve_wikipedia, | |
| "arxiv": retrieve_arxiv, | |
| "web": retrieve_web, | |
| } | |
| __all__ = [ | |
| "retrieve_supabase", | |
| "retrieve_wikipedia", | |
| "retrieve_arxiv", | |
| "retrieve_web", | |
| "TOOL_REGISTRY", | |
| "RetrieverFn", | |
| ] | |