Fix linting
This commit is contained in:
@@ -87,7 +87,9 @@ class NanoVectorDBStorage(BaseVectorStorage):
|
|||||||
vector_db_kwargs = self.global_config.get("vector_db_storage_cls_kwargs", {})
|
vector_db_kwargs = self.global_config.get("vector_db_storage_cls_kwargs", {})
|
||||||
self.cosine_better_than_threshold = vector_db_kwargs.get(
|
self.cosine_better_than_threshold = vector_db_kwargs.get(
|
||||||
"cosine_better_than_threshold",
|
"cosine_better_than_threshold",
|
||||||
self.global_config.get("cosine_better_than_threshold", self.cosine_better_than_threshold)
|
self.global_config.get(
|
||||||
|
"cosine_better_than_threshold", self.cosine_better_than_threshold
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
async def upsert(self, data: dict[str, dict]):
|
async def upsert(self, data: dict[str, dict]):
|
||||||
@@ -137,7 +139,9 @@ class NanoVectorDBStorage(BaseVectorStorage):
|
|||||||
async def query(self, query: str, top_k=5):
|
async def query(self, query: str, top_k=5):
|
||||||
embedding = await self.embedding_func([query])
|
embedding = await self.embedding_func([query])
|
||||||
embedding = embedding[0]
|
embedding = embedding[0]
|
||||||
logger.info(f"Query: {query}, top_k: {top_k}, cosine_better_than_threshold: {self.cosine_better_than_threshold}")
|
logger.info(
|
||||||
|
f"Query: {query}, top_k: {top_k}, cosine_better_than_threshold: {self.cosine_better_than_threshold}"
|
||||||
|
)
|
||||||
results = self._client.query(
|
results = self._client.query(
|
||||||
query=embedding,
|
query=embedding,
|
||||||
top_k=top_k,
|
top_k=top_k,
|
||||||
|
@@ -1028,7 +1028,7 @@ async def _build_query_context(
|
|||||||
# not necessary to use LLM to generate a response
|
# not necessary to use LLM to generate a response
|
||||||
if not entities_context.strip() and not relations_context.strip():
|
if not entities_context.strip() and not relations_context.strip():
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return f"""
|
return f"""
|
||||||
-----Entities-----
|
-----Entities-----
|
||||||
```csv
|
```csv
|
||||||
|
Reference in New Issue
Block a user