Download src/retrieval/base.py from DataEyond/Agentic-Service-Data-Eyond-Catalog: direct link, hf CLI and curl.
- Browser
- Download file 444 Bytes
-
https://huggingface.co/spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog/resolve/717452f69ec32394dea2a8fc11aba47eebe5bc53/src/retrieval/base.py
- Command line
-
hf download hf://spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog@717452f69ec32394dea2a8fc11aba47eebe5bc53/src/retrieval/base.py
-
curl -L -o base.py https://huggingface.co/spaces/DataEyond/Agentic-Service-Data-Eyond-Catalog/resolve/717452f69ec32394dea2a8fc11aba47eebe5bc53/src/retrieval/base.py
444 Bytes
| """Shared types for the retrieval layer.""" | |
| from abc import ABC, abstractmethod | |
| from dataclasses import dataclass | |
| from typing import Any | |
| class RetrievalResult: | |
| content: str | |
| metadata: dict[str, Any] | |
| score: float | |
| source_type: str # "document" | "database" | |
| class BaseRetriever(ABC): | |
| async def retrieve( | |
| self, query: str, user_id: str, k: int = 5 | |
| ) -> list[RetrievalResult]: ... | |