Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions vechord/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ async def run_dynamic_pipeline(request: RunRequest, vr: "VechordRegistry"): # n
dim = emb.get_dim()
index: IndexOption = calls.get("index")
search: SearchOption = calls.get("search")
# configure the registry
vr.ns = request.name
vr.reset_namespace(request.name)

if index is None and search is None:
raise ValueError("No index or search option specified in the request")
Expand Down Expand Up @@ -133,7 +132,7 @@ class Chunk(_DefaultChunk):
vec=vec,
doc_id=doc.uid,
text=chunks[i],
keyword=Keyword(text=chunks[i]) if use_keyword_index else None,
keyword=Keyword(chunks[i]) if use_keyword_index else None,
)
)
return RunAck(name=request.name, msg="succeed", uid=doc.uid)
Expand Down
4 changes: 4 additions & 0 deletions vechord/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ async def process_shutdown(self, scope, event):
"""Falcon ASGI middleware lifespan hook."""
await self.__aexit__(None, None, None)

def reset_namespace(self, namespace: str):
self.ns = namespace
self.client.ns = namespace

async def init_table_index(self, tables: Optional[Iterable[type[Table]]] = None):
if tables is None:
tables = self.tables
Expand Down