<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
| Container | Options 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 },
});
| Option | What it does |
|---|---|
speed | The 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. |
acceleration | How 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. |
instant | true 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. |
onCitationLink | A function that changes each citation link. See Citation Links. |
format | markdown, the default, or plaintext. |
tag | The tag of the element that holds the text. The default is div for markdown and p for plaintext. |
className | The class of that element, in place of miso-typewriter. The cursor at the end of the text has the class name with __cursor added. |
builtInStyles | false removes the miso-markdown class, and with it the SDK styles for paragraphs, lists, tables and code in the answer. |
Links in the answer
| The reader selects | What happens |
|---|---|
A citation, such as [2] | The SDK records a click on that source. |
| Any other link | The 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
- Ask — Citation Links: the class, the attributes, the URL and the tooltip of each citation.
- Ask — Events: run your own code as the answer arrives and when it is done.
<miso-sources>: the articles that the citations point to.
