Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Update parameter order in API.search

davidmezzettie288b7bd3598
diff --git a/src/python/txtai/api/base.py b/src/python/txtai/api/base.py
index df004e7b..404dae47 100644
--- a/src/python/txtai/api/base.py
+++ b/src/python/txtai/api/base.py
@@ -23,7 +23,7 @@ class API(Application):
self.cluster = Cluster(self.config["cluster"])
# pylint: disable=W0221
- def search(self, query, request=None, limit=None):
+ def search(self, query, limit=None, request=None):
# When search is invoked via the API, limit is set from the request
# When search is invoked directly, limit is set using the method parameter
limit = self.limit(request.query_params.get("limit") if request and hasattr(request, "query_params") else limit)
diff --git a/src/python/txtai/api/routers/embeddings.py b/src/python/txtai/api/routers/embeddings.py
index 84295daa..c40608e6 100644
--- a/src/python/txtai/api/routers/embeddings.py
+++ b/src/python/txtai/api/routers/embeddings.py
@@ -27,7 +27,7 @@ def search(query: str, request: Request):
list of {id: value, score: value}
"""
- return application.get().search(query, request)
+ return application.get().search(query, request=request)
@router.post("/batchsearch")