langchain.retrievers.kendra.QueryResultItem¶

class langchain.retrievers.kendra.QueryResultItem(*, Id: Optional[str] = None, DocumentId: Optional[str] = None, DocumentURI: Optional[str] = None, DocumentAttributes: Optional[List[DocumentAttribute]] = [], DocumentTitle: TextWithHighLights, FeedbackToken: Optional[str] = None, Format: Optional[str] = None, Type: Optional[str] = None, AdditionalAttributes: Optional[List[AdditionalResultAttribute]] = [], DocumentExcerpt: Optional[TextWithHighLights] = None, **extra_data: Any)[source]¶

Bases: ResultItem

A Query API result item.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

param AdditionalAttributes: Optional[List[langchain.retrievers.kendra.AdditionalResultAttribute]] = []¶

One or more additional attributes associated with the result.

param DocumentAttributes: Optional[List[langchain.retrievers.kendra.DocumentAttribute]] = []¶

The document attributes.

param DocumentExcerpt: Optional[langchain.retrievers.kendra.TextWithHighLights] = None¶

Excerpt of the document text.

param DocumentId: Optional[str] = None¶

The document ID.

param DocumentTitle: langchain.retrievers.kendra.TextWithHighLights [Required]¶

The document title.

param DocumentURI: Optional[str] = None¶

The document URI.

param FeedbackToken: Optional[str] = None¶

Identifies a particular result from a particular query.

param Format: Optional[str] = None¶
If the Type is ANSWER, then format is either:
  • TABLE: a table excerpt is returned in TableExcerpt;

  • TEXT: a text excerpt is returned in DocumentExcerpt.

param Id: Optional[str] = None¶

The ID of the item.

param Type: Optional[str] = None¶

Type of result: DOCUMENT or QUESTION_ANSWER or ANSWER

get_additional_metadata() dict[source]¶

Document additional metadata dict. This returns any extra metadata except these values: [‘source’, ‘title’, ‘excerpt’ and ‘document_attributes’].

get_attribute_value() str[source]¶
get_document_attributes_dict() dict¶
get_excerpt() str[source]¶

Document excerpt or passage.

get_title() str[source]¶

Document title.

to_doc() Document¶