Citation element
This is a rich text element, compatible only with the rich_text block. It must be used within the rich_text_list, rich_text_quote, or rich_text_section block element within the rich_text block's elements array.
Fields
| Field | Type | Description | Required? |
|---|---|---|---|
type | String | The type of object; in this case, "citation". | Required |
url | String | The URL of the cited source. | Required |
text | String | The display text for the citation. | Required |
index | Number | The index of the citation. | Required |
details | Object | Details about the cited source. This can be a file, external, web, message, or memory object. See below for the schemas of each. | Required |
from_llm | Boolean | Indicates whether the citation was generated by the LLM itself. | Optional |
is_slack_url | Boolean | Indicates whether the citation is a Slack URL. | Optional |
The following schemas are the options for the details object.
The file object:
{
"citation_type":
{
"type" : "string",
"enum": "file"
},
"descriptor":
{
"type": "string"
},
"file_id":
{
"type": "string"
}
}
The external object:
{
"citation_type":
{
"type": "string",
"enum": "external"
},
"app_name":
{
"type": "string"
},
"app_icon_url":
{
"type": "string"
}
}
The web object:
{
"citation_type":
{
"type": "string",
"enum": "web"
},
"display_name":
{
"type": "string"
},
"title":
{
"type": "string"
},
"snippet":
{
"type": "string"
}
}
The message object:
{
"citation_type":
{
"type": "string",
"enum": "message"
},
"channel":
{
"type": "string"
},
"message_ts":
{
"type": "string"
}
}
The memory object:
{
"citation_type":
{
"type": "string",
"enum": "memory"
},
"memory_id":
{
"type": "string"
}
}
Example
- JSON
{
"blocks": [
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "citation",
"url": "https://example.com/source",
"text": "Source title",
"index": 1,
"details": {
"citation_type": "file",
"descriptor": "Team canvas",
"file_id": "F0ABCDEFG12"
}
}
]
}
]
}
]
}