Skip to main content

AiResponse

Use the AiResponse component to animate AI-generated content.

AiResponseProps

extends, , , , ,
NameTypeDefaultDescription
children

The content to be displayed as markdown.

customCodeBlockRenderers?
<, <>>
undefined

A map of fenced code block languages to components that render the content of such a block instead of the default code snippet. A fenced block opened with the language dt-visualization is handed to the renderer registered under 'dt-visualization'; blocks with any other language and inline code keep their default rendering. Provide a stable reference, for example by wrapping the map in useMemo.

onAnimationStateChange?
(isAnimating: ) =>

Callback that is called whenever the animation state changes.

responseState?
| |
'streaming'

Controls how the content is rendered and animated.

  • 'static': Renders the entire response immediately with no animation.
  • 'streaming': Animates content as it streams in.
  • 'complete': Indicates streaming has finished and the full content has been passed. The component will finish animating any remaining content and turn off animation.
Still have questions?
Find answers in the Dynatrace Community