PromptTemplate doesn't work with multi layer metadata (e.g. BedrockKnowledgeBase/AmazonKnowledgeBasesRetriever) #28354
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
No response
Description
I'm trying to use Langchain as a conversational retrieval chain to pull documents with metadata from BedrockKnowledgeBase, include the document prompt with some Bedrock Metadata in the prompt template.
The document metadata for the Document object looks like:
metadata: {
location: "s3://xyz",
score: 0.654,
source_metadata: { field_i_want: 123, another_field: 456}
}
The prompt template is failing in base_get_document_info() on the missing_metadata check as it only draws on the base level of metadata.
The following is a (hack) resolution:
however the tactical resolution would be to somehow allow the dict path to be specified.
System Info
System Information
Package Information
Optional packages not installed
Other Dependencies
The text was updated successfully, but these errors were encountered: