mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-23 00:43:18 +00:00
up
This commit is contained in:
parent
ef0b74b3e7
commit
7cd2838c98
1 changed files with 3 additions and 5 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
"""In-memory file store with JSONL persistence on close."""
|
"""In-memory file store with JSONL persistence on close."""
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
@ -117,7 +115,7 @@ class LocalFileStore(BaseFileStore):
|
||||||
# Search
|
# Search
|
||||||
|
|
||||||
async def vector_search(
|
async def vector_search(
|
||||||
self, query: str, limit: int, search_filter: dict,
|
self, query: str, limit: int, search_filter: dict,
|
||||||
) -> list[FileChunk]:
|
) -> list[FileChunk]:
|
||||||
if not self.vector_enabled or not query:
|
if not self.vector_enabled or not query:
|
||||||
return []
|
return []
|
||||||
|
|
@ -140,7 +138,7 @@ class LocalFileStore(BaseFileStore):
|
||||||
return results[:limit]
|
return results[:limit]
|
||||||
|
|
||||||
async def keyword_search(
|
async def keyword_search(
|
||||||
self, query: str, limit: int, search_filter: dict,
|
self, query: str, limit: int, search_filter: dict,
|
||||||
) -> list[FileChunk]:
|
) -> list[FileChunk]:
|
||||||
if not self.fts_enabled or not query.split():
|
if not self.fts_enabled or not query.split():
|
||||||
return []
|
return []
|
||||||
|
|
@ -168,4 +166,4 @@ class LocalFileStore(BaseFileStore):
|
||||||
base = matches / len(words)
|
base = matches / len(words)
|
||||||
if len(words) > 1 and query.lower() in text_lower:
|
if len(words) > 1 and query.lower() in text_lower:
|
||||||
base = min(1.0, base + 0.2)
|
base = min(1.0, base + 0.2)
|
||||||
return base
|
return base
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue