소스 검색

Refa: add meta data to retrieval. (#6676)

### What problem does this PR solve?

#6619
### Type of change


- [x] Performance Improvement
tags/v0.18.0
Kevin Hu 7 달 전
부모
커밋
60b9c027c8
No account linked to committer's email address
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2
    3
      agent/component/retrieval.py

+ 2
- 3
agent/component/retrieval.py 파일 보기

@@ -24,6 +24,7 @@ from api.db.services.llm_service import LLMBundle
from api import settings
from agent.component.base import ComponentBase, ComponentParamBase
from rag.app.tag import label_question
from rag.prompts import kb_prompt
from rag.utils.tavily_conn import Tavily


@@ -102,9 +103,7 @@ class Retrieval(ComponentBase, ABC):
df["empty_response"] = self._param.empty_response
return df

df = pd.DataFrame(kbinfos["chunks"])
df["content"] = df["content_with_weight"]
del df["content_with_weight"]
df = pd.DataFrame({"content": kb_prompt(kbinfos, 200000)})
logging.debug("{} {}".format(query, df))
return df.dropna()


Loading…
취소
저장