mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-17 02:03:44 +00:00
langchain_community: Add default None values to DocumentAttributeValue class properties (#28785)
**Description**: This PR addresses an issue where the DocumentAttributeValue class properties did not have default values of None. By explicitly setting the Optional attributes (DateValue, LongValue, StringListValue, and StringValue) to default to None, this change ensures the class functions as expected when no value is provided for these attributes. **Changes Made**: Added default None values to the following properties of the DocumentAttributeValue class: DateValue LongValue StringListValue StringValue Removed the invalid argument extra="allow" from the BaseModel inheritance. Dependencies: None. **Twitter handle (optional)**: @__korikori1021 **Checklist** - [x] Verified that KendraRetriever works as expected after the changes. Co-authored-by: y1u0d2a1i <y.kotani@raksul.com>
This commit is contained in:
parent
90f7713399
commit
05a44797ee
@ -119,13 +119,13 @@ class AdditionalResultAttribute(BaseModel, extra="allow"): # type: ignore[call-
|
||||
class DocumentAttributeValue(BaseModel, extra="allow"): # type: ignore[call-arg]
|
||||
"""Value of a document attribute."""
|
||||
|
||||
DateValue: Optional[str]
|
||||
DateValue: Optional[str] = None
|
||||
"""The date expressed as an ISO 8601 string."""
|
||||
LongValue: Optional[int]
|
||||
LongValue: Optional[int] = None
|
||||
"""The long value."""
|
||||
StringListValue: Optional[List[str]]
|
||||
StringListValue: Optional[List[str]] = None
|
||||
"""The string list value."""
|
||||
StringValue: Optional[str]
|
||||
StringValue: Optional[str] = None
|
||||
"""The string value."""
|
||||
|
||||
@property
|
||||
|
Loading…
Reference in New Issue
Block a user