Ask a question to get started
Enter to sendā¢Shift+Enter new line
CohereCitation( self, start: int, end: int, text: str, documents:
The index of text that the citation starts at, counting from zero.
For example, a generation of 'Hello, world!' with a citation on 'world' would have a start value of 7. This is because the citation starts at 'w', which is the seventh character.
'Hello, world!'
'world'
7
'w'
The index of text that the citation ends after, counting from zero.
For example, a generation of 'Hello, world!' with a citation on 'world' would have an end value of 11. This is because the citation ends after 'd', which is the eleventh character.
11
'd'
The text of the citation.
For example, a generation of 'Hello, world!' with a citation of 'world' would have a text value of 'world'.
The contents of the documents that were cited.
When used with agents these will be the contents of relevant agent outputs.
Every document will have a string field called id. This can be used with the document_ids field to deduplicate documents across several citations. The id field is created on the document when it doesn't already exist.
id
document_ids
A set of the id field from all the documents in the documents field.
documents
Cohere has fine-grained citations that specify the exact part of text.
.. deprecated:: 0.6.0 Only used by the deprecated create_cohere_react_agent.
create_cohere_react_agent
More info at https://docs.cohere.com/docs/documents-and-citations