mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-31 15:47:05 +00:00
fix: FIx GraphRAG build error (#1706)
This commit is contained in:
parent
bf978d2bf9
commit
0d85c7154a
@ -8,7 +8,10 @@ from typing import Any, Dict, List, Optional
|
|||||||
from dbgpt._private.pydantic import BaseModel, ConfigDict, Field, model_to_dict
|
from dbgpt._private.pydantic import BaseModel, ConfigDict, Field, model_to_dict
|
||||||
from dbgpt.core import Chunk, Embeddings
|
from dbgpt.core import Chunk, Embeddings
|
||||||
from dbgpt.storage.vector_store.filters import MetadataFilters
|
from dbgpt.storage.vector_store.filters import MetadataFilters
|
||||||
from dbgpt.util.executor_utils import blocking_func_to_async
|
from dbgpt.util.executor_utils import (
|
||||||
|
blocking_func_to_async,
|
||||||
|
blocking_func_to_async_no_executor,
|
||||||
|
)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -195,4 +198,6 @@ class IndexStoreBase(ABC):
|
|||||||
filters: Optional[MetadataFilters] = None,
|
filters: Optional[MetadataFilters] = None,
|
||||||
) -> List[Chunk]:
|
) -> List[Chunk]:
|
||||||
"""Aynsc similar_search_with_score in vector database."""
|
"""Aynsc similar_search_with_score in vector database."""
|
||||||
return self.similar_search_with_scores(doc, topk, score_threshold, filters)
|
return await blocking_func_to_async_no_executor(
|
||||||
|
self.similar_search_with_scores, doc, topk, score_threshold, filters
|
||||||
|
)
|
||||||
|
@ -267,10 +267,6 @@ class EmbeddingRetriever(BaseRetriever):
|
|||||||
"score_threshold": score_threshold,
|
"score_threshold": score_threshold,
|
||||||
},
|
},
|
||||||
):
|
):
|
||||||
return await blocking_func_to_async_no_executor(
|
return await self._index_store.asimilar_search_with_scores(
|
||||||
self._index_store.similar_search_with_scores,
|
query, self._top_k, score_threshold, filters
|
||||||
query,
|
|
||||||
self._top_k,
|
|
||||||
score_threshold,
|
|
||||||
filters,
|
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user