Citations
Magisterium AI API conforms to the OpenAI API, with a few additions in the response object. One addition is the citations
field.
{
"object": "chat.completion",
"created": 1630000000,
"model": "magisterium-1",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The Catholic Church's teaching on faith and morals is deeply rooted in Scripture [...]",
},
"finish_reason": "stop",
},
],
"citations": [
{
"cited_text": "34. Church teaching on moral matters is founded not only on reason and argument, but also on Scripture and the Christian tradition [...]",
"document_title": "Cherishing Life",
"document_index": 0,
"document_author": "Catholic Bishops’ Conference of England and Wales",
"document_reference": "34"
}
]
// other fields ...
}
json
Streaming
The citations
field is also included when stream is enabled, but only on one chunk, which is the last chunk that includes finish_reason
.
For example:
{
"object": "chat.completion.chunk",
"choices": [
{
"index": 0,
"delta": {},
"finish_reason": "stop",
},
],
"citations": [
{
"cited_text": "34. Church teaching on moral matters is founded not only on reason and argument, but also on Scripture and the Christian tradition [...]",
"document_title": "Cherishing Life",
"document_index": 0,
"document_author": "Catholic Bishops’ Conference of England and Wales",
"document_reference": "34"
}
]
// other fields ...
}
json
Schema
The citations
field is an array of objects with the following fields:
Field Name | Type | Description |
---|---|---|
cited_text | string | The text that was cited. |
cited_text_heading | string / null | The nearest heading of the given citation. |
document_title | string / null | The title of the document. |
document_index | integer | The index of the document in the response object. Index is zero-based, while inline footnotes numbering is one-based. |
document_author | string / null | The author of the document. |
document_year | string / null | The year the document was published. |
document_reference | string / null | The reference number of the citation. |
source_url | string | The source URL. |