---
title: "富文本 AI 响应"
description: "通过富文本、列表等格式，启用 AI 在你的 Tiptap 编辑器中自动格式化生成的内容。详见我们的文档！"
canonical_url: "https://tiptap.zhcndoc.com/content-ai/capabilities/generation/text-generation/format"
---

# 富文本 AI 响应

通过富文本、列表等格式，启用 AI 在你的 Tiptap 编辑器中自动格式化生成的内容。详见我们的文档！

- **1. 激活试用或订阅**

  在你的账户中开始一个[免费试用](https://cloud.tiptap.dev/v2?trial=true)或[订阅 Start 计划](https://cloud.tiptap.dev/v2/billing)。
- **2. 集成 AI 提供商**

  在你的 AI 设置 中配置 OpenAI，或查阅 自定义 LLM 指南。
- **3. 从私有注册表安装**

  若要安装前端扩展，按照 设置指南，对 Tiptap 私有 npm 注册表进行认证。

> **Interactive demo:** [AiFormattedResponse](https://embed-pro.tiptap.dev/preview/Extensions/AiFormattedResponse)

通过 `format: 'rich-text'` 选项，你可以生成带有内容格式的 AI 响应。这在你需要生成包含加粗、斜体、链接等富文本格式的内容时特别有用。

```ts
// 将响应以富文本格式流式传输到编辑器
editor
  .chain()
  .aiTextPrompt({
    text: '写一份流行编程语言列表',
    stream: true,
    format: 'rich-text',
  })
  .run()
```
