[CAI-879] Add the google reranker by LlamaIndex#2202
Conversation
🦋 Changeset detectedLatest commit: 6c373bd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Branch is not up to date with base branch@mdciri it seems this Pull Request is not updated with base branch. |
There was a problem hiding this comment.
Pull request overview
This PR migrates the chatbot’s Google reranking integration to the maintained LlamaIndex Google reranker package and adds a small wrapper to avoid asyncio event-loop binding issues during async request handling.
Changes:
- Replace the custom Google reranker implementation with a wrapper around
llama_index.postprocessor.google_rerank.GoogleRerankthat lazily creates the async Discovery Engine client. - Update RAG tool setup to construct scoped service-account credentials and configure the reranker with model/project/location.
- Switch the local
__main__server entrypoint tollama_index.core.async_utils.asyncio_run.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/chatbot/src/modules/tools/rag_tool.py | Wires in AsyncSafeGoogleRerank and builds Google service-account credentials for reranking. |
| apps/chatbot/src/modules/google_reranker.py | Replaces the custom reranker with an async-safe wrapper around LlamaIndex’s Google reranker. |
| apps/chatbot/src/app/main.py | Uses LlamaIndex’s asyncio_run helper to run the Hypercorn server coroutine. |
| apps/chatbot/pyproject.toml | Adds the LlamaIndex Google rerank postprocessor dependency. |
| apps/chatbot/poetry.lock | Locks the new dependency (and updates lock metadata). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Jira Pull Request LinkThis Pull Request refers to the following Jira issue CAI-879 |
List of Changes
Add the use of the Google Ranker by LlamaIndex with safe asynchronicity.
Motivation and Context
Use a maintained library.
How Has This Been Tested?
Locally in docker compose and in DEV
Screenshots (if appropriate):
Types of changes
Checklist: