> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/share-files-with-the-room.md).

# 与房间共享文件

了解当你在聊天体验房间中给消息附加文件时，角色会接收到什么，以及房间之后会保留什么。

你在某个 [聊天体验](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences.md) 房间中发送的消息可以携带文件。文件从不以文件本身的形式交给角色：他们收到的是文本——要么是文件原本包含的文字，要么是为它编写的描述。这些页面涵盖每种文件会变成什么、房间会向你显示什么，以及对话结束后会保留什么。

### 角色收到的内容

文件会发送给该轮消息所面向的角色。未被消息面向的角色不会收到该文件，后续回复也不会再传递它。如果你希望每个角色都收到文件，请把消息发送给所有人——标记 `@everyone`，或者将回复标签设置为 **所有人都必须回复**——在你发送之前。参见 [选择谁回复](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/running-the-room/choose-who-replies.md).

那些角色收到的是文本，而且只有文本。房间传递的是文字，所以你附加的每个文件在传送之前都会先变成文字。

这会通过两种方式发生。包含文字的文件会以其自身的文字形式共享：PDF、Word 文件以及所有纯文本格式都会以其所包含的文本传达给角色。包含图片的文件不能以这种方式共享，因此会写出图片的描述，角色收到的则是该描述。角色会被告知这些文字是在描述你附加的一张图片，而他们只能根据这份描述来作答。

你共享的文件属于你共享它的那段对话。每个新对话开始时都没有已共享内容。

### 每种文件会变成什么

| 你附加的内容                                 | 角色收到的内容                |
| -------------------------------------- | ---------------------- |
| 纯文本文件——`.txt`, `.md`, `.csv`，或 `.json` | 文件自身的文本                |
| Word 文件——`.docx`                       | 文档的文本                  |
| 一份载有大量正文的 PDF                          | 文档的文本                  |
| 一份自身文字很少的 PDF                          | 其中包含的任何文本，然后是其前几页的文字描述 |
| 一张图片——`.png`, `.jpg`，或 `.jpeg`         | 对图片的文字描述               |

PDF 是唯一一种会有两种结果的格式，而且两种结果都正确。 [共享文档](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/share-files-with-the-room/share-a-document.md) 说明你会得到哪一种，以及房间会如何告诉你。

### 当文件无法读取时

房间无法读取的文件仍会被发送。角色只会收到它的名称，别无其他，消息也不会被拦截。

在发送之前，无法提前知道某个文件的内容是否能被共享。你会在之后才知道。你附加的每个文件都会在输入框上方出现一个标签，而该标签的第二行会在文件处理完后确定下来。如果文件的内容没有被共享，这一行会说明这一点；如果房间无法读取某个文件——或者无法描述一张图片——也会弹出一条提及该文件名的消息。

用于附加文件的回形针图标只有在消息框被锁定时才会变灰。没有任何文件会让它不可用。参见 [你无法发送消息](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/troubleshooting/composer-is-locked.md) 的所有消息框上锁原因。

### 房间保留什么

房间保留的是文件名，而不是文件内容。发送后，有三个地方会显示该文件：

* **对话线程。** 你发送的消息会为随消息附带的每个文件显示一个标签。
* **侧边栏。** 其 **在房间中共享** 部分列出本次对话到目前为止发送的文件，每个文件都显示名称、与标签相同的第二行，以及一条说明角色收到了什么的注释。 [文件限制参考](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/share-files-with-the-room/file-limits-reference.md) 说明每条注释的含义，而 [运行房间](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/running-the-room.md) 则涵盖面板的其他部分。
* **已完成会话的记录稿。** 它会记录每一轮携带的所有文件名，而你下载的记录稿会在对应轮次下列出这些名称。参见 [回顾过去的会话](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/sessions-and-transcripts/review-a-past-session.md) 以及 [导出记录稿](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/sessions-and-transcripts/export-a-transcript.md).

**清空对话** 在房间的三点菜单中会清空 **在房间中共享** 列表以及对话线程。参见 [房间控制参考](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/running-the-room/room-controls-reference.md).

由于只保留文件名，过去会话线程中的每个文件都会显示为名称，不管当时它发生了什么。记录稿只会记录某个文件曾被共享，而不会记录角色从中收到了什么。

### 哪一页回答哪个问题

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>共享文档</strong><br>附加 PDF、Word 文件或纯文本文件，并查看标签报告了什么。</td><td><a href="/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/share-files-with-the-room/share-a-document.md">共享文档</a></td></tr><tr><td><strong>共享图片</strong><br>附加一张图片，并理解角色会被告知什么。</td><td><a href="/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/share-files-with-the-room/share-an-image.md">共享图片</a></td></tr><tr><td><strong>文件限制参考</strong><br>可接受的文件类型、大小和文本限制，以及每种类型会发生什么。</td><td><a href="/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/share-files-with-the-room/file-limits-reference.md">文件限制参考</a></td></tr></tbody></table>

附加文件的消息框是房间三个工作部分之一。

{% content-ref url="/pages/2a2f97d08c3487b60a613b33320d63e9352288a4" %}
[运行房间](/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/running-the-room.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.convai.com/api-docs/zh/wu-dai-ma-ti-yan/chat-experiences/share-files-with-the-room.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
