fix: natural_language_retriever.py
This commit is contained in:
parent
85c7f11eb8
commit
50ebcedf37
1 changed files with 5 additions and 2 deletions
|
|
@ -1,8 +1,7 @@
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
from cognee.shared.logging_utils import get_logger
|
from cognee.shared.logging_utils import get_logger
|
||||||
from cognee.infrastructure.databases.graph import get_graph_engine
|
from cognee.infrastructure.databases.graph import get_graph_engine
|
||||||
from cognee.infrastructure.llm.get_llm_client import get_llm_client
|
from cognee.infrastructure.llm.LLMGateway import LLMGateway
|
||||||
from cognee.infrastructure.llm.prompts import render_prompt
|
|
||||||
from cognee.modules.retrieval.base_retriever import BaseRetriever
|
from cognee.modules.retrieval.base_retriever import BaseRetriever
|
||||||
from cognee.modules.retrieval.exceptions import SearchTypeNotSupported
|
from cognee.modules.retrieval.exceptions import SearchTypeNotSupported
|
||||||
from cognee.infrastructure.databases.graph.graph_db_interface import GraphDBInterface
|
from cognee.infrastructure.databases.graph.graph_db_interface import GraphDBInterface
|
||||||
|
|
@ -122,6 +121,10 @@ class NaturalLanguageRetriever(BaseRetriever):
|
||||||
query.
|
query.
|
||||||
"""
|
"""
|
||||||
graph_engine = await get_graph_engine()
|
graph_engine = await get_graph_engine()
|
||||||
|
|
||||||
|
if isinstance(graph_engine, (NetworkXAdapter)):
|
||||||
|
raise SearchTypeNotSupported("Natural language search type not supported.")
|
||||||
|
|
||||||
return await self._execute_cypher_query(query, graph_engine)
|
return await self._execute_cypher_query(query, graph_engine)
|
||||||
|
|
||||||
async def get_completion(self, query: str, context: Optional[Any] = None) -> Any:
|
async def get_completion(self, query: str, context: Optional[Any] = None) -> Any:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue