<miso-answer>

The generated answer. It types out as it arrives, with a number for each source it cites:

<miso-ask>
  <miso-answer></miso-answer>
  <miso-sources></miso-sources>
</miso-ask>

Containers

ContainerOptions from
<miso-ask>client.ui.asks
<miso-hybrid-search>client.ui.hybridSearch
<miso-message-item>client.ui.conversation

You do not write <miso-message-item> yourself. <miso-messages> puts one in each message of the open thread, with a <miso-answer> in it.

To change the answer, call useLayouts on the workflow of the container, under the role answer. For Ask, use client.ui.asks, the context, so that follow-up answers get the change too.

Options

Your options are merged over the defaults, so set only what you change.

client.ui.asks.useLayouts({
  answer: { speed: 300 },
});
OptionWhat it does
speedThe typing speed, in characters per second. The default is 100. Each step is a random amount between half and one and a half times this speed.
accelerationHow fast the typing speeds up after the whole answer has arrived. Each second after that, the speed goes up by this many times the base speed. The default is 4, and 0 turns it off.
instanttrue shows at once the part of the answer that has arrived, and types out only the rest. The messages of <miso-conversation> set it, so an answer from an earlier visit shows complete.
onCitationLinkA function that changes each citation link. See Citation Links.
formatmarkdown, the default, or plaintext.
tagThe tag of the element that holds the text. The default is div for markdown and p for plaintext.
classNameThe class of that element, in place of miso-typewriter. The cursor at the end of the text has the class name with __cursor added.
builtInStylesfalse removes the miso-markdown class, and with it the SDK styles for paragraphs, lists, tables and code in the answer.
The reader selectsWhat happens
A citation, such as [2]The SDK records a click on that source.
Any other linkThe link opens, and the SDK records a click on the answer.

The clicks are recorded as interactions. See Ask — Interactions and Hybrid Search — Interactions.

Next