Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add RAG LLMReranker #784

Merged
merged 20 commits into from
Jan 10, 2025
Merged

feat: Add RAG LLMReranker #784

merged 20 commits into from
Jan 10, 2025

Conversation

@ishaansehgal99 ishaansehgal99 changed the title feat: Add Reranker feat: Add RAG reranker Dec 17, 2024
@ishaansehgal99 ishaansehgal99 changed the title feat: Add RAG reranker feat: Add RAG Reranker Dec 17, 2024
@ishaansehgal99 ishaansehgal99 changed the title feat: Add RAG Reranker feat: Add RAG LLMReranker Dec 17, 2024
"""
=========================================================================
"""

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low priority: we can reorg these params to cli args and using structured params instead of raw key-value dict.

@zhuangqh
Copy link
Collaborator

unit test fails

__________ ERROR collecting presets/ragengine/tests/api/test_main.py ___________
presets/ragengine/tests/api/test_main.py:8: in <module>
    from ragengine.main import app, vector_store_handler, rag_ops
presets/ragengine/main.py:5: in <module>
    from vector_store_manager.manager import VectorStoreManager
presets/ragengine/vector_store_manager/manager.py:7: in <module>
    from ragengine.vector_store.base import BaseVectorStore
presets/ragengine/vector_store/base.py:25: in <module>
    class BaseVectorStore(ABC):
presets/ragengine/vector_store/base.py:96: in BaseVectorStore
    rerank_params: Optional[Dict] = None
E   NameError: name 'Optional' is not defined
___ ERROR collecting presets/ragengine/tests/vector_store/test_base_store.py ___
presets/ragengine/tests/vector_store/test_base_store.py:9: in <module>
    from ragengine.vector_store.base import BaseVectorStore
presets/ragengine/vector_store/base.py:25: in <module>
    class BaseVectorStore(ABC):
presets/ragengine/vector_store/base.py:96: in BaseVectorStore
    rerank_params: Optional[Dict] = None
E   NameError: name 'Optional' is not defined
_ ERROR collecting presets/ragengine/tests/vector_store/test_chromadb_store.py _
presets/ragengine/tests/vector_store/test_chromadb_store.py:9: in <module>
    from ragengine.tests.vector_store.test_base_store import BaseVectorStoreTest
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
../../../.local/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:184: in exec_module
    exec(co, module.__dict__)
presets/ragengine/tests/vector_store/test_base_store.py:9: in <module>
    from ragengine.vector_store.base import BaseVectorStore
presets/ragengine/vector_store/base.py:25: in <module>
    class BaseVectorStore(ABC):
presets/ragengine/vector_store/base.py:96: in BaseVectorStore
    rerank_params: Optional[Dict] = None
E   NameError: name 'Optional' is not defined
__ ERROR collecting presets/ragengine/tests/vector_store/test_faiss_store.py ___
presets/ragengine/tests/vector_store/test_faiss_store.py:8: in <module>
    from ragengine.tests.vector_store.test_base_store import BaseVectorStoreTest
<frozen importlib._bootstrap>:1360: in _find_and_load
    ???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:935: in _load_unlocked
    ???
../../../.local/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:184: in exec_module
    exec(co, module.__dict__)
presets/ragengine/tests/vector_store/test_base_store.py:9: in <module>
    from ragengine.vector_store.base import BaseVectorStore
presets/ragengine/vector_store/base.py:25: in <module>
    class BaseVectorStore(ABC):
presets/ragengine/vector_store/base.py:96: in BaseVectorStore
    rerank_params: Optional[Dict] = None
E   NameError: name 'Optional' is not defined

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

"query": "what is the capital of france?",
"top_k": 5,
"llm_params": {"temperature": 0.7},
"rerank_params": {"top_n": top_n}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the list of parameters that we can change here?

Copy link
Collaborator Author

@ishaansehgal99 ishaansehgal99 Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the parameters

class QueryRequest(BaseModel):
    index_name: str
    query: str
    top_k: int = 10
    llm_params: Optional[Dict] = None  # Accept a dictionary for parameters
    rerank_params: Optional[Dict] = None # Accept a dictionary for parameters

@ishaansehgal99 ishaansehgal99 merged commit 5351ff8 into main Jan 10, 2025
3 of 6 checks passed
@ishaansehgal99 ishaansehgal99 deleted the Ishaan/rerank branch January 10, 2025 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants