Learn how to render custom markdown responses in the C1 UI.
makeC1Response
function to create a c1Response
object, and then use the writeCustomMarkdown
method to write the custom response to
the response object:
Create a c1Response object
makeC1Response
function to create a c1Response
object by importing it from the @thesysai/genui-sdk
package, and start writing the LLM response
content to this object:Write a custom markdown response to the response object
writeCustomMarkdown
method defined on the c1Response
object:c1Response
, custom markdown responses take priority over LLM responses on the UI (ie: they will be the only thing rendered when present in the response),
even if the LLM response is also present in c1Response
.Therefore, although not strictly necessary, it is recommended to return early when using custom markdown responses to avoid invoking the C1 API. This can prevent
unnecessary token usage.Test it out