Ask a Smart Assistant a question
List your Smart Assistants, then ask one of them a question through the API and read its sources.
A Smart Assistant answers questions from a chosen set of content, with its own instructions. Through the API you can ask one of them a question and read the sources it used.
Find the assistant
List the assistants available to the user:
query listAssistants {
me {
smartAssistants(first: 10) {
edges {
node {
id
label
}
}
}
}
}
The response:
{
"data": {
"me": {
"smartAssistants": {
"edges": [
{ "node": { "id": "U21hcnRBc3Npc3RhbnQ6MQ==", "label": "Security Advisor" } },
{ "node": { "id": "U21hcnRBc3Npc3RhbnQ6Mg==", "label": "Product Documentation" } },
{ "node": { "id": "U21hcnRBc3Npc3RhbnQ6Mw==", "label": "Customer Success Agent" } }
]
}
}
}
}
Ask the question
Read the assistant by ID with node and call answer on it:
query askAssistant {
node(id: "U21hcnRBc3Npc3RhbnQ6Mg==") {
... on SmartAssistant {
answer(query: "What is a tag in Elium?") {
text
sources {
... on Story {
slug
version {
title
}
}
... on AnswerAssetSource {
asset {
__typename
... on FileAsset {
filename
}
}
}
}
}
}
}
}
The response:
{
"data": {
"node": {
"answer": {
"text": "In Elium, a tag is a keyword or label used to classify and organise information. Tags are grouped into families, called categories, and they help to filter content within the platform. Tags make it easier to find specific information and create dynamic entry points to it.",
"sources": [
{
"asset": {
"__typename": "FileAsset",
"filename": "product documentation export.pdf"
}
}
]
}
}
}
}
The answer has the same shape as the one from Elium Answer: a text and a list of sources, each a Story or an AnswerAssetSource.