Buckets:

download
raw
1.17 kB
from abc import ABC, abstractmethod
from cognee.infrastructure.engine import DataPoint
class BaseContextProvider(ABC):
"""
Base class for context retrieval strategies.
This class serves as a blueprint for creating different strategies that retrieve context
based on specified entities and a query. Any subclass must implement the `get_context`
method to define how context is retrieved.
"""
@abstractmethod
async def get_context(self, entities: list[DataPoint], query: str) -> str:
"""
Get relevant context based on extracted entities and original query.
This method must be implemented by subclasses to define the logic for retrieving context
relevant to the provided `entities` and `query`. It is an asynchronous method that will
return a string representing the context.
Parameters:
-----------
- entities (List[DataPoint]): A list of data points representing extracted entities
relevant to the query.
- query (str): The original query string used to extract the entities and retrieve
context.
"""
pass

Xet Storage Details

Size:
1.17 kB
·
Xet hash:
43cdb39794865df74e615f32432b44a23ba5c5df32db30aae6a9f9cacbc1a10d

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.