langchain_cohere.common.CohereCitation

class langchain_cohere.common.CohereCitation(start: int, end: int, text: str, documents: List[Mapping[str, Any]], document_ids: Set[str])[source]

Cohere has fine-grained citations that specify the exact part of text. More info at https://docs.cohere.com/docs/documents-and-citations

Attributes

start

The index of text that the citation ends after, counting from zero.

end

The text of the citation.

text

The contents of the documents that were cited.

documents

A set of the id field from all the documents in the documents field.

document_ids

Methods

__init__(start, end, text, documents, ...)

Parameters
  • start (int) –

  • end (int) –

  • text (str) –

  • documents (List[Mapping[str, Any]]) –

  • document_ids (Set[str]) –

__init__(start: int, end: int, text: str, documents: List[Mapping[str, Any]], document_ids: Set[str]) None
Parameters
  • start (int) –

  • end (int) –

  • text (str) –

  • documents (List[Mapping[str, Any]]) –

  • document_ids (Set[str]) –

Return type

None