> 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/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability.md).

# 对话可用性

查找用于检查某个 Convai 角色当前是否能听到玩家，以及在不能时如何在 UI 中响应的指南。

会话可用性决定 Convai Unity SDK 如何回答：玩家现在是否可以与某个角色对话，以及当无法对话时是什么阻碍了他们。已连接的房间并不意味着被指定的角色能听到任何内容——服务必须先把该角色宣布上线，而且 `ConvaiManager.ConversationAvailability` 是这个答案唯一所在的地方。SDK 中任何接收玩家输入的部分都会先询问它。

<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>了解各状态、为什么仅有已连接房间还不够，以及可用性与角色就绪标志有何不同。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/how-availability-works.md">对话可用性如何运作</a></td></tr><tr><td><strong>根据可用性控制你的 UI</strong><br>将自定义聊天输入框、发送按钮或麦克风控件绑定到当前判定结果。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/gate-your-ui.md">根据可用性控制 UI</a></td></tr><tr><td><strong>自定义聊天输入框提示</strong><br>重写随附聊天输入框显示的每一种状态提示，并调整其慢连接提示。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/customise-chat-prompts.md">自定义聊天输入框提示</a></td></tr><tr><td><strong>在玩家开始说话时作出响应</strong><br>在 Convai 自身确认判定之前，订阅本地麦克风和按住说话活动。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/local-player-activity.md">响应玩家开始说话</a></td></tr><tr><td><strong>会话可用性参考</strong><br>查阅所有与限制玩家输入相关的状态、事件和方法。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/availability-reference.md">对话可用性参考</a></td></tr><tr><td><strong>排查玩家输入问题</strong><br>修复被拒绝的消息、一直处于禁用状态的聊天输入框，或无法打开的麦克风。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/troubleshooting.md">玩家输入故障排查</a></td></tr></tbody></table>

### 可用性从哪里来

可用性不是一个整个房间范围的标志。它是针对 `ConvaiManager.AddressedCharacter` ——也就是玩家当前正在与之交谈的对象——进行回答，所以同一个房间可以报告一个角色 `就绪` 处于可用状态，而另一个角色仍处于 `Preparing`。对单个角色而言，同样的答案也可在 `ConvaiCharacter.ConversationAvailability`上获得，适用于绑定到某个特定角色而不是当前被呼叫对象的 UI。参见 [会话可用性如何工作](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/how-availability-works.md) 了解这些状态背后的模型。

### 下一步

从 [会话可用性如何工作](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/how-availability-works.md) 开始了解这些状态，然后 [根据可用性控制你的 UI](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability/gate-your-ui.md) 将你自己的输入界面连接到它。

{% content-ref url="/pages/f76eaea2a343c7d72b93487d582ec00dd7ba1c58" %}
[多角色会话](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/multi-character-sessions.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/cha-jian-yu-ji-cheng/convai-unity-sdk/features/conversation-availability.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.
