选项

unsafe_allow_html
布尔值
默认值:

在消息中处理并显示 HTML。这可能存在安全风险(参见 https://stackoverflow.com/questions/19603097/why-is-it-dangerous-to-render-user-generated-html-or-javascript)。

edit_message
布尔值
默认值:

允许用户编辑其消息。

latex
布尔值
默认值:

处理并显示数学表达式。这可能与消息中的“$”字符冲突。

spontaneous_file_upload.enabled
布尔值
默认值:

授权用户随消息上传文件。文件随后可通过 cl.on_message 进行访问。

spontaneous_file_upload.accept
Union[List[str], Dict[str, List[str]]]
默认值:["*/*"]

限制用户仅上传允许的 MIME 文件类型。例如: [“text/plain”, “application/pdf”, “image/x-png”]

spontaneous_file_upload.max_files
int
默认值:20

限制用户一次上传文件的最大数量。

spontaneous_file_upload.max_size_mb
int
默认值:500

限制上传文件大小(MB)。

auto_tag_thread
布尔值

使用当前的聊天配置文件自动标记会话(如果使用了聊天配置文件)

默认配置

[features]
edit_message = true
unsafe_allow_html = false
latex = false
[features.spontaneous_file_upload]
    enabled = true
    accept = ["*/*"]
    max_files = 20
    max_size_mb = 500
auto_tag_thread = true