AmazonKendraRetriever forces to have all the fields required #28124
Replies: 1 comment 7 replies
-
Hey @smg6135! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve this issue. To make fields optional in Pydantic 2.X, you can use from typing import Optional
from pydantic import BaseModel
class AmazonKendraRetriever(BaseModel):
index_id: str
region_name: Optional[str] = None
credentials_profile_name: Optional[str] = None
# other fields... In this example, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
After the update of langchain_community, internally we use pydantic 2.X. Pydantic 2.X seems to force all fields required unlike Pydantic 1, which causes an error when invoke(query) on the retriever. What would be the recommended fix?
Beta Was this translation helpful? Give feedback.
All reactions