mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-22 00:32:49 +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."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
|
|
@ -117,7 +115,7 @@ class LocalFileStore(BaseFileStore):
|
|||
# Search
|
||||
|
||||
async def vector_search(
|
||||
self, query: str, limit: int, search_filter: dict,
|
||||
self, query: str, limit: int, search_filter: dict,
|
||||
) -> list[FileChunk]:
|
||||
if not self.vector_enabled or not query:
|
||||
return []
|
||||
|
|
@ -140,7 +138,7 @@ class LocalFileStore(BaseFileStore):
|
|||
return results[:limit]
|
||||
|
||||
async def keyword_search(
|
||||
self, query: str, limit: int, search_filter: dict,
|
||||
self, query: str, limit: int, search_filter: dict,
|
||||
) -> list[FileChunk]:
|
||||
if not self.fts_enabled or not query.split():
|
||||
return []
|
||||
|
|
@ -168,4 +166,4 @@ class LocalFileStore(BaseFileStore):
|
|||
base = matches / len(words)
|
||||
if len(words) > 1 and query.lower() in text_lower:
|
||||
base = min(1.0, base + 0.2)
|
||||
return base
|
||||
return base
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue