Magisterium AI

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 NameTypeDescription
cited_textstringThe text that was cited.
cited_text_headingstring / nullThe nearest heading of the given citation.
document_titlestring / nullThe title of the document.
document_indexintegerThe index of the document in the response object. Index is zero-based, while inline footnotes numbering is one-based.
document_authorstring / nullThe author of the document.
document_yearstring / nullThe year the document was published.
document_referencestring / nullThe reference number of the citation.
source_urlstringThe source URL.