Skip to content

The agent engineering platform.

Added missing attribute value object (#6849)

Piyush Jaine53995836aff
diff --git a/langchain/retrievers/kendra.py b/langchain/retrievers/kendra.py
index d694a20430..c86b812244 100644
--- a/langchain/retrievers/kendra.py
+++ b/langchain/retrievers/kendra.py
@@ -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):