Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16803

how to make conversationalretrievalchain to include metadata in the prompt using langchain with chromadb to make the LLM aware of metadata?

$
0
0

im trying to do a bot that answer questions from a chromadb , i have stored multiple pdf files with metadata like the filename and candidate name , my problem is when i use conversational retrieval chain the LLM model just receive page_content without the metadata , i want the LLM model to be aware of the page_content with its metadata like filename and candidate namehere is my code

conversation_chain=ConversationalRetrievalChain.from_llm(        llm=llm,        retriever=SelfQueryRetriever.from_llm(llm,vectorstore,document_content_description,metadata_field_info),        memory=memory,        verbose=True,    )

and here is my attribute info

metadata_field_info = [    AttributeInfo(        name="filename",        description="The name of the resumee",        type="string",    ),    AttributeInfo(        name="candidatename",        description="the name of the candidate",        type="string"    )]

Viewing all articles
Browse latest Browse all 16803

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>