Skip to content

Commit

Permalink
Marked Query Routing as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninoLorenzo committed Aug 9, 2024
1 parent a7905fd commit 66efe1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/agent/knowledge/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from src.agent.knowledge.nlp import extract_keywords, similarity
from src.agent.llm import LLM
from src.agent.prompts import PROMPTS
from src.utils.deprecated import deprecated


class Router(ABC):
Expand All @@ -18,6 +19,7 @@ def find_route(self, user_query: str, collections) -> str:
raise NotImplementedError()


@deprecated(reason="Query Routing is going to be removed.")
class SimilarityRouter(Router):
"""Uses NLP techniques to find a candidate collection for a given query"""

Expand Down Expand Up @@ -56,6 +58,7 @@ def find_route(self, user_query: str, collections) -> str:
return max(points, key=lambda k: points[k])


@deprecated(reason="Query Routing is going to be removed.")
class LLMRouter(Router):
"""Uses a Large Language Model to find candidate collection for given query.
Using a local model is not the best choice for performance, HuggingFace
Expand Down
2 changes: 2 additions & 0 deletions src/agent/knowledge/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from src.agent.knowledge.collections import Collection, Document, Topic
from src.agent.knowledge.nlp import chunk
from src.agent.knowledge.routing import Router
from src.utils.deprecated import deprecated


class Store:
Expand Down Expand Up @@ -134,6 +135,7 @@ def upload(self, document: Document, collection_name: str):
# self._collections[collection_name].documents.append(document)
self._collections[collection_name].size = current_len + len(emb_chunks)

@deprecated(reason="Query Routing is handled by LLM tool calling.")
def retrieve(self, query: str, limit: int = 3):
"""Performs Query Routing and Retrieval of chunks"""
if not self._query_router:
Expand Down

0 comments on commit 66efe1e

Please sign in to comment.