Added missing attribute value object (#6849)

## Description
Adds a missing type class for
[AdditionalResultAttributeValue](https://docs.aws.amazon.com/kendra/latest/APIReference/API_AdditionalResultAttributeValue.html).
Fixes validation failure for the query API that have
`AdditionalAttributes` in the response.

cc @dev2049 
cc @zhichenggeng
pull/6853/head
Piyush Jain 1 year ago committed by GitHub
parent e494b0a09f
commit e53995836a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,16 +32,17 @@ class TextWithHighLights(BaseModel, extra=Extra.allow):
Highlights: Optional[Any]
class AdditionalResultAttributeValue(BaseModel, extra=Extra.allow):
TextWithHighlightsValue: TextWithHighLights
class AdditionalResultAttribute(BaseModel, extra=Extra.allow):
Key: str
ValueType: Literal["TEXT_WITH_HIGHLIGHTS_VALUE"]
Value: Optional[TextWithHighLights]
Value: AdditionalResultAttributeValue
def get_value_text(self) -> str:
if not self.Value:
return ""
else:
return self.Value.Text
return self.Value.TextWithHighlightsValue.Text
class QueryResultItem(BaseModel, extra=Extra.allow):

Loading…
Cancel
Save