Validation Exception #424
Replies: 2 comments
-
I have fixed it. Thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have fixed it. Thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am getting below exception while implementing agentic RAG, following your example from the file "rag-solutions/llamaindex-examples/2_llama_index_bedrock_kb.ipynb":
ValidationException: An error occurred (ValidationException) when calling the Retrieve operation: failed to create query: Field 'file_name.keyword' not found. Rewrite first
Below are the only changes I did in the original file to make it work for my use case:
knowledge_base_id = "my knowledge base id that exists in Bedrock"
llm = Bedrock(model = "anthropic.claude-3-sonnet-20240229-v1:0",region="ap-south-1")
embed_model = BedrockEmbedding(model = "cohere.embed-multilingual-v3",region="ap-south-1")
large_cap_fname = "Nippon India Large Cap Fund.pdf.md" #name of the actual file in the S3 bucket
large_cap_retriever = AmazonKnowledgeBasesRetriever(
knowledge_base_id=knowledge_base_id,
retrieval_config={
"vectorSearchConfiguration": {
"numberOfResults": top_k,
"overrideSearchType": search_mode,
"filter": {"equals": {"key": "file_name", "value": large_cap_fname}},
}
},
)
large_cap_engine = RetrieverQueryEngine(retriever=large_cap_retriever)
growth_fname = "Nippon India Growth Fund.pdf.md" #name of the actual file in the S3 bucket
growth_retriever = AmazonKnowledgeBasesRetriever(
knowledge_base_id=knowledge_base_id,
retrieval_config={
"vectorSearchConfiguration": {
"numberOfResults": top_k,
"overrideSearchType": search_mode,
"filter": {"equals": {"key": "file_name", "value": growth_fname}},
}
},
)
growth_engine = RetrieverQueryEngine(retriever=growth_retriever)
tools = [
QueryEngineTool(
query_engine=large_cap_engine,
metadata=ToolMetadata(
name="Large_Cap",
description="Facts about Nippon India Large Cap Fund June 2024",
),
)
,
QueryEngineTool(
query_engine=growth_engine,
metadata=ToolMetadata(
name="Growth",
description="Facts about Nippon India Growth Fund June 2024",
),
),
]
I get the exception when I generate the response using the below command:
response = await query_engine.aquery('Compare the portfolio share of ICICI Bank Ltd. between Large Cap & Growth Fund')
Please note that the knowledgebase exists and the .md files exist too in the knowledgebase as data sources.
Please help me fixing this issue.
Thanks,
Abhinav
Beta Was this translation helpful? Give feedback.
All reactions