> For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt.

# sendFollowUpMessage

以用户身份发送后续消息，触发新一轮对话、API 调用或引导模型响应。

## 扫码预览

![扫码预览 sendFollowUpMessage](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fopen%252Fsend-follow-up-message%252Findex)

## 支持版本

前端库版本不低于 `0.0.37`。

## 支持平台

<table>
<thead>
<tr><th>平台</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>Android</td><td>支持</td></tr>
<tr><td>iOS</td><td>支持</td></tr>
<tr><td>PC</td><td>不支持</td></tr>
<tr><td>HarmonyOS</td><td>不支持</td></tr>
</tbody>
</table>

## 支持场景

<table>
<thead>
<tr><th>场景</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>页面</td><td>支持</td></tr>
<tr><td>卡片</td><td>支持</td></tr>
</tbody>
</table>

## 接入准备

### 前置条件

- **Android**：在卡片或应用插件页面中调用
- **iOS**：在卡片或应用插件页面中调用，且当前上下文已关联有效会话

## 使用说明

可在卡片或应用插件页面中调用，不支持在 app.ts 代码中调用。客户端会根据调用上下文关联会话：
卡片使用其所在会话，从卡片打开的页面沿用该会话，其他页面使用主会话。

- Promise 解析表示发送请求已提交，不表示消息已成功送达；实际发送失败不会通过该 Promise 返回。

## 调用方式

### 异步 API

```typescript
sendFollowUpMessage(params: SendFollowUpMessageParams): Promise<object>
```

## 入参

<table>
<thead>
<tr><th>名称</th><th>类型</th><th>必填</th><th>默认值</th><th>约束</th><th>说明</th></tr>
</thead>
<tbody>
<tr><td><code>content</code></td><td><code>Content[]</code></td><td>是</td><td>-</td><td>至少包含一条 text 类型且 text 不为空白的消息；第一条符合条件的消息作为本轮用户输入。</td><td>消息内容。</td></tr>
</tbody>
</table>

### `content[].type = "text"`

<table>
<thead>
<tr><th>名称</th><th>类型</th><th>必填</th><th>默认值</th><th>约束</th><th>说明</th></tr>
</thead>
<tbody>
<tr><td><code>content[].type</code></td><td><code>&quot;text&quot;</code></td><td>是</td><td>-</td><td>-</td><td>文本消息。</td></tr>
<tr><td><code>content[].text</code></td><td><code>string</code></td><td>是</td><td>-</td><td>-</td><td>后续消息的文本内容。</td></tr>
</tbody>
</table>

### `content[].type = "api/call"`

<table>
<thead>
<tr><th>名称</th><th>类型</th><th>必填</th><th>默认值</th><th>约束</th><th>说明</th></tr>
</thead>
<tbody>
<tr><td><code>content[].type</code></td><td><code>&quot;api/call&quot;</code></td><td>是</td><td>-</td><td>-</td><td>API 调用消息。</td></tr>
<tr><td><code>content[].data</code></td><td><code>object</code></td><td>是</td><td>-</td><td>-</td><td>要调用的 API 及其参数。</td></tr>
<tr><td><code>content[].data.arguments</code></td><td><code>object</code></td><td>是</td><td>-</td><td>-</td><td>API 调用参数。</td></tr>
<tr><td><code>content[].data.name</code></td><td><code>string</code></td><td>是</td><td>-</td><td>-</td><td>API 名称。</td></tr>
</tbody>
</table>

### `content[].type = "responseHint"`

<table>
<thead>
<tr><th>名称</th><th>类型</th><th>必填</th><th>默认值</th><th>约束</th><th>说明</th></tr>
</thead>
<tbody>
<tr><td><code>content[].type</code></td><td><code>&quot;responseHint&quot;</code></td><td>是</td><td>-</td><td>-</td><td>模型响应提示。</td></tr>
<tr><td><code>content[].data</code></td><td><code>object</code></td><td>是</td><td>-</td><td>-</td><td>用户动作和模型响应建议。</td></tr>
<tr><td><code>content[].data.responseGuidance</code></td><td><code>string</code></td><td>否</td><td><code>-</code></td><td>-</td><td>建议模型如何响应。</td></tr>
<tr><td><code>content[].data.userAction</code></td><td><code>string</code></td><td>否</td><td><code>-</code></td><td>-</td><td>用户做了什么。</td></tr>
</tbody>
</table>

## 调用示例

```typescript
import { sendFollowUpMessage } from '@doubao-dev/framework/api';

await sendFollowUpMessage({
  content: [
    { type: 'text', text: '选择拿铁' },
    {
      type: 'api/call',
      data: {
        name: 'selectDrink',
        arguments: { drinkId: 'latte_001' }
      }
    },
    {
      type: 'responseHint',
      data: {
        userAction: '用户选择了拿铁',
        responseGuidance: '确认已选择拿铁，并询问是否需要调整杯型'
      }
    }
  ]
});
```

## 成功返回

无返回字段。
