镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 14:36:48 +00:00
Resolve LlamaIndexRagWorker bug
这个提交包含在:
@@ -11,7 +11,19 @@ RAG_WORKER_REGISTER = {}
|
|||||||
MAX_HISTORY_ROUND = 5
|
MAX_HISTORY_ROUND = 5
|
||||||
MAX_CONTEXT_TOKEN_LIMIT = 4096
|
MAX_CONTEXT_TOKEN_LIMIT = 4096
|
||||||
REMEMBER_PREVIEW = 1000
|
REMEMBER_PREVIEW = 1000
|
||||||
|
# Main Q&A function with document upload support
|
||||||
|
@CatchException
|
||||||
|
def Rag问答(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, user_request):
|
||||||
|
|
||||||
|
# import vector store lib
|
||||||
|
VECTOR_STORE_TYPE = "Milvus"
|
||||||
|
if VECTOR_STORE_TYPE == "Milvus":
|
||||||
|
try:
|
||||||
|
from crazy_functions.rag_fns.milvus_worker import MilvusRagWorker as LlamaIndexRagWorker
|
||||||
|
except:
|
||||||
|
VECTOR_STORE_TYPE = "Simple"
|
||||||
|
if VECTOR_STORE_TYPE == "Simple":
|
||||||
|
from crazy_functions.rag_fns.llama_index_worker import LlamaIndexRagWorker
|
||||||
@CatchException
|
@CatchException
|
||||||
def handle_document_upload(files: List[str], llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, user_request):
|
def handle_document_upload(files: List[str], llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, user_request):
|
||||||
"""
|
"""
|
||||||
@@ -59,19 +71,6 @@ def handle_document_upload(files: List[str], llm_kwargs, plugin_kwargs, chatbot,
|
|||||||
|
|
||||||
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
yield from update_ui(chatbot=chatbot, history=history) # 刷新界面
|
||||||
|
|
||||||
# Main Q&A function with document upload support
|
|
||||||
@CatchException
|
|
||||||
def Rag问答(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, user_request):
|
|
||||||
|
|
||||||
# import vector store lib
|
|
||||||
VECTOR_STORE_TYPE = "Milvus"
|
|
||||||
if VECTOR_STORE_TYPE == "Milvus":
|
|
||||||
try:
|
|
||||||
from crazy_functions.rag_fns.milvus_worker import MilvusRagWorker as LlamaIndexRagWorker
|
|
||||||
except:
|
|
||||||
VECTOR_STORE_TYPE = "Simple"
|
|
||||||
if VECTOR_STORE_TYPE == "Simple":
|
|
||||||
from crazy_functions.rag_fns.llama_index_worker import LlamaIndexRagWorker
|
|
||||||
|
|
||||||
# 1. we retrieve rag worker from global context
|
# 1. we retrieve rag worker from global context
|
||||||
user_name = chatbot.get_user()
|
user_name = chatbot.get_user()
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户