ResultItem#

class langchain_community.retrievers.kendra.ResultItem[source]#

Bases: BaseModel, ABC

Base class of a 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 DocumentAttributes: List[DocumentAttribute] | None = []#

The document attributes.

param DocumentId: str | None = None#

The document ID.

param DocumentURI: str | None = None#

The document URI.

param Id: str | None = None#

The ID of the relevant result item.

param ScoreAttributes: dict | None = None#

The kendra score confidence

get_additional_metadata() dict[source]#

Document additional metadata dict. This returns any extra metadata except these:

  • result_id

  • document_id

  • source

  • title

  • excerpt

  • document_attributes

Return type:

dict

get_document_attributes_dict() Dict[str, str | int | List[str] | None][source]#

Document attributes dict.

Return type:

Dict[str, str | int | List[str] | None]

abstract get_excerpt() str[source]#

Document excerpt or passage original content as retrieved by Kendra.

Return type:

str

get_score_attribute() str[source]#

Document Score Confidence

Return type:

str

abstract get_title() str[source]#

Document title.

Return type:

str

to_doc(page_content_formatter: ~typing.Callable[[~langchain_community.retrievers.kendra.ResultItem], str] = <function combined_text>) Document[source]#

Converts this item to a Document.

Parameters:

page_content_formatter (Callable[[ResultItem], str]) –

Return type:

Document