POST
/
explanation
curl --request POST \
  --url https://api.totoy.ai/v1/explanation \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "output_language": "en",
  "language_level": "plain",
  "source_id": "src_dmZ7imKLaPcQnv5ckvGlOEAA7",
  "markdown_response": true
}'
{
  "project_id": "pj_avX7imfLaPcQnv5ckvGlOEBA9",
  "output_language": "en",
  "language_level": "plain",
  "source_id": "src_dmZ7imKLaPcQnv5ckvGlOEAA7",
  "answer": {
    "role": "assistant",
    "content": "Hey!\nThis is a letter from the Austrian tax office.\nThey are informing you about your obligation to submit quarterly VAT returns if your annual turnover is more than €35,000.\nHowever, if you submit a VAT return for the month of January on time, you can choose to submit monthly returns instead.\nIf your annual turnover is more than €100,000, you are required to submit monthly VAT returns.\nSince your VAT returns and payments for 2021 do not cover the entire period, they are asking you to fill out the enclosed form to provide your actual annual turnover.\nThis is important to avoid sending you incorrect reminders.\nIf you have any questions, you can contact the service center at 050 233 233.\nTake care!"
  },
  "markdown_response": true
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
output_language
enum<string>
required

The ISO 639-1 code for the language in which the Explanation should be generated. Supported Languages:

  • ar: Arabic
  • bs: Bosnian
  • cs: Czech
  • de: German
  • es: Spanish
  • en: English
  • fa: Farsi
  • fr: French
  • hr: Croatian
  • hu: Hungarian
  • it: Italian
  • pl: Polish
  • ro: Romanian
  • sk: Slovak
  • sl: Slovenian
  • sr: Serbian
  • tl: Tagalog
  • tr: Turkish
  • uk: Ukrainian
Available options:
ar,
bs,
cs,
de,
es,
en,
fa,
fr,
hr,
hu,
it,
pl,
ro,
sk,
sl,
sr,
tl,
tr,
uk
language_level
enum<string>
required

One of three language levels for the generated text:

  1. Simple Language: Answers are short and simple, using easy words and a clear structure.
  2. Plain Language: Answers are short and the assistant explains complicated terms.
  3. Detailed Language: Answers are not simplified and the assistant answers in detail.
Available options:
simple,
plain,
detailed
source_id
string
required

The unique identifier of the uploaded Source to be used as context for the Explanation.

Maximum length: 29
messages
object[]

The conversation history. For an initial Explanation just provide an empty array or no messages. For follow-up questions, provide the entire conversation history.

markdown_response
boolean
default: true

Whether the response should be returned as Markdown formatted text. If 'false', the response will be returned in plain text.

Response

200 - application/json
project_id
string
required

The unique identifier of the Project this Explanation was assigned to. The Explanation will be assigned to the project_id of the Source.

Maximum length: 28
output_language
enum<string>
required

The ISO 639-1 code for the language in which the Explanation should be generated. Supported Languages:

  • ar: Arabic
  • bs: Bosnian
  • cs: Czech
  • de: German
  • es: Spanish
  • en: English
  • fa: Farsi
  • fr: French
  • hr: Croatian
  • hu: Hungarian
  • it: Italian
  • pl: Polish
  • ro: Romanian
  • sk: Slovak
  • sl: Slovenian
  • sr: Serbian
  • tl: Tagalog
  • tr: Turkish
  • uk: Ukrainian
Available options:
ar,
bs,
cs,
de,
es,
en,
fa,
fr,
hr,
hu,
it,
pl,
ro,
sk,
sl,
sr,
tl,
tr,
uk
language_level
enum<string>
required

One of three language levels for the generated text:

  1. Simple Language: Answers are short and simple, using easy words and a clear structure.
  2. Plain Language: Answers are short and the assistant explains complicated terms.
  3. Detailed Language: Answers are not simplified and the assistant answers in detail.
Available options:
simple,
plain,
detailed
source_id
string
required

The unique identifier of the uploaded Source that was used as context for the Explanation.

Maximum length: 29
answer
object
required

Represents a message within an Explanation or a Knowledge Base Chat. For Explanations - An assistant message is either an initial Explanation for the document when no messages were provided in the request or an answer to a user message in the provided conversation history.

markdown_response
boolean
required

Whether the response is a Markdown formatted text.