Spaces:
Running
Running
Asish Karthikeya Gogineni commited on
Commit ·
e5ab135
1
Parent(s): 9debe89
fix: Use invoke() instead of deprecated get_relevant_documents()
Browse files- Fixed AttributeError: 'RerankingRetriever' object has no attribute 'get_relevant_documents'
- Replaced deprecated LangChain method calls with .invoke()
- Kept context enhancements (top-30 files, file tree, full content)
- code_chatbot/rag.py +2 -1
code_chatbot/rag.py
CHANGED
|
@@ -414,7 +414,8 @@ class ChatEngine:
|
|
| 414 |
query_for_retrieval = f"{self.chat_history[-1].content} {question}"
|
| 415 |
|
| 416 |
# Increase retrieval limit to 30 docs since Gemini has large context
|
| 417 |
-
|
|
|
|
| 418 |
|
| 419 |
if not docs:
|
| 420 |
# Return empty context if no docs found
|
|
|
|
| 414 |
query_for_retrieval = f"{self.chat_history[-1].content} {question}"
|
| 415 |
|
| 416 |
# Increase retrieval limit to 30 docs since Gemini has large context
|
| 417 |
+
# FIXED: Use .invoke() instead of .get_relevant_documents() (deprecated/removed in LC 0.1)
|
| 418 |
+
docs = self.retriever.invoke(query_for_retrieval)
|
| 419 |
|
| 420 |
if not docs:
|
| 421 |
# Return empty context if no docs found
|