> 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-unreal-engine-plugin/blueprint-reference/convai-utility-functions.md).

# Convai 工具函数

查找用于凝视查询、组件查找、音频工具、设置、诊断和命令行标志的跨领域 Blueprint 帮助节点。

`UConvaiUtils` 是一个 `UBlueprintFunctionLibrary` ，用于向 Blueprint 暴露各种辅助节点。它无需附加到 `Actor`；所有节点都可从任意 Blueprint 图表中调用。节点在 Blueprint 节点搜索面板中归类到 **Convai** 类别树下。

本页仅介绍跨功能的实用工具库。特定功能的 Blueprint 库请参阅相应功能参考页面：

| 库 / 接口                      | 文档位置                                                                                                                                                                       |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `UConvaiActions` （操作参数访问器）  | [Actions Blueprint 参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/character-actions/actions-blueprint-reference.md)     |
| 动态上下文传输辅助工具                 | [动态上下文 Blueprint 参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/dynamic-context/dynamic-context-blueprint-reference.md) |
| 除 `UConvaiChatbotComponent` | [之外的情绪辅助工具](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/emotion/emotion-blueprint-reference.md)                          |
| LTM 说话者和身份辅助工具              | [LTM Blueprint 参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/long-term-memory/ltm-blueprint-reference.md)              |
| 注视高亮控件和 Actor               | [注视注意力参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/gaze-attention/gaze-attention-reference.md)                        |

### 视线目标辅助工具

这些节点会检测玩家控制器摄像机附近已注册的 Convai 组件，并返回位于配置半径范围内且满足摄像机前向角度阈值的候选对象。

#### `ConvaiGetLookedAtCharacter`

类别： `Convai|Utilities`

返回 `UConvaiChatbotComponent` ，该组件位于玩家当前注视的角色上。

| 引脚                   | 方向 | 类型                         | 说明                                          |
| -------------------- | -- | -------------------------- | ------------------------------------------- |
| `WorldContextObject` | 输入 | `UObject*`                 | 世界上下文（在 Blueprint 中自动连线）。                   |
| `PlayerController`   | 输入 | `APlayerController*`       | 用于确定视线方向的控制器，其摄像机朝向将作为依据。                   |
| `Radius`             | 输入 | `float`                    | 以世界单位表示的搜索半径，从摄像机位置开始计算。                    |
| `PlaneView`          | 输入 | `bool`                     | 当 `true`时，仅使用水平面角度（忽略垂直俯仰角）。                |
| `IncludedCharacters` | 输入 | `TArray<UObject*>`         | 可选允许列表——仅考虑这些对象。传入空数组则考虑所有对象。               |
| `ExcludedCharacters` | 输入 | `TArray<UObject*>`         | 可选拒绝列表 — 始终跳过这些对象。                          |
| `ConvaiCharacter`    | 输出 | `UConvaiChatbotComponent*` | 找到的聊天机器人组件，或 `nullptr` 当 `Found` 为 `false`. |
| `Found`              | 输出 | `bool`                     | `true` 当在 `Radius`.                         |

{% hint style="info" %}
`IncludedCharacters` 和 `ExcludedCharacters` 会自动创建其引用术语，因此你可以在蓝图中将两者留空，节点将搜索所有已注册的聊天机器人组件。
{% endhint %}

#### `ConvaiGetLookedAtObjectOrCharacter`

类别： `Convai|Utilities`

从提供的列表中返回 `FConvaiObjectEntry` （对象或角色），即玩家当前正在注视的对象或角色。需要检测玩家在一组混合对象和角色中的视线关注目标时，请使用此节点。

| 引脚                       | 方向 | 类型                           | 说明                         |
| ------------------------ | -- | ---------------------------- | -------------------------- |
| `WorldContextObject`     | 输入 | `UObject*`                   | 世界上下文（在 Blueprint 中自动连线）。  |
| `PlayerController`       | 输入 | `APlayerController*`         | 用于获取摄像机朝向的控制器。             |
| `Radius`                 | 输入 | `float`                      | 以世界单位表示的搜索半径。              |
| `PlaneView`              | 输入 | `bool`                       | 当 `true`时，仅使用水平面角度。        |
| `ListToSearchIn`         | 输入 | `TArray<FConvaiObjectEntry>` | 要搜索的对象和角色列表。               |
| `FoundObjectOrCharacter` | 输出 | `FConvaiObjectEntry`         | 匹配的条目；若 `Found` 为 `false`. |
| `Found`                  | 输出 | `bool`                       | `true` 当在 `Radius`.        |

### 组件查找

这些节点无需直接对象引用，即可查询世界中已注册的 Convai 组件。

#### `ConvaiGetAllChatbotComponents`

类别： `Convai|Utilities`

返回当前在世界中注册的所有 `UConvaiChatbotComponent` 实例。

| 引脚                        | 方向 | 类型                                 | 说明                                      |
| ------------------------- | -- | ---------------------------------- | --------------------------------------- |
| `WorldContextObject`      | 输入 | `UObject*`                         | 世界上下文（在 Blueprint 中自动连线）。               |
| `bOnlyConnected`          | 输入 | `bool`                             | 当 `true`时，仅返回会话处于 `Connected` 状态的聊天机器人。 |
| `ConvaiChatbotComponents` | 输出 | `TArray<UConvaiChatbotComponent*>` | 所有匹配的聊天机器人组件。                           |
| `OutOwners`               | 输出 | `TArray<AActor*>`                  | 所属 Actor，顺序与 `ConvaiChatbotComponents`. |

#### `GetFirstConvaiChatbotComponent`

类别： `Convai|Utilities`

返回在世界中找到的第一个 `UConvaiChatbotComponent` ——当场景中只有一个角色时，这是一个便捷的快捷方式。

| 引脚                   | 方向 | 类型                         | 说明                                    |
| -------------------- | -- | -------------------------- | ------------------------------------- |
| `WorldContextObject` | 输入 | `UObject*`                 | 世界上下文（在 Blueprint 中自动连线）。             |
| `bOnlyConnected`     | 输入 | `bool`                     | 当 `true`时，仅考虑处于 `Connected` 状态的聊天机器人。 |
| `Return value`       | 输出 | `UConvaiChatbotComponent*` | 第一个匹配的组件；如果不存在， `nullptr` 。           |
| `OutOwner`           | 输出 | `AActor*`                  | 返回组件所属的 Actor。                        |

#### `ConvaiGetAllPlayerComponents`

类别： `Convai|Utilities`

返回当前在世界中注册的所有 `UConvaiPlayerComponent` 实例。

| 引脚                       | 方向 | 类型                                | 说明                                     |
| ------------------------ | -- | --------------------------------- | -------------------------------------- |
| `WorldContextObject`     | 输入 | `UObject*`                        | 世界上下文（在 Blueprint 中自动连线）。              |
| `bOnlyConnected`         | 输入 | `bool`                            | 当 `true`时，仅返回会话状态为 `Connected`.        |
| `ConvaiPlayerComponents` | 输出 | `TArray<UConvaiPlayerComponent*>` | 所有匹配的玩家组件。                             |
| `OutOwners`              | 输出 | `TArray<AActor*>`                 | 所属 Actor，顺序与 `ConvaiPlayerComponents`. |

#### `GetFirstConvaiPlayerComponent`

类别： `Convai|Utilities`

返回在世界中找到的第一个 `UConvaiPlayerComponent` 。

| 引脚                   | 方向 | 类型                        | 说明                              |
| -------------------- | -- | ------------------------- | ------------------------------- |
| `WorldContextObject` | 输入 | `UObject*`                | 世界上下文（在 Blueprint 中自动连线）。       |
| `bOnlyConnected`     | 输入 | `bool`                    | 当 `true`时，仅考虑会话状态为 `Connected`. |
| `Return value`       | 输出 | `UConvaiPlayerComponent*` | 第一个匹配的组件；如果不存在， `nullptr` 。     |
| `OutOwner`           | 输出 | `AActor*`                 | 返回组件所属的 Actor。                  |

#### `ConvaiGetAllObjectComponents`

类别： `Convai|Utilities`

返回当前在世界中注册的所有 `UConvaiObjectComponent` 实例。

| 引脚                       | 方向 | 类型                                | 说明                                     |
| ------------------------ | -- | --------------------------------- | -------------------------------------- |
| `WorldContextObject`     | 输入 | `UObject*`                        | 世界上下文（在 Blueprint 中自动连线）。              |
| `ConvaiObjectComponents` | 输出 | `TArray<UConvaiObjectComponent*>` | 所有已注册的对象组件。                            |
| `OutOwners`              | 输出 | `TArray<AActor*>`                 | 所属 Actor，顺序与 `ConvaiObjectComponents`. |

#### `GetFirstConvaiObjectComponent`

类别： `Convai|Utilities`

返回第一个 `UConvaiObjectComponent` （在世界中找到的）。

| 引脚                   | 方向 | 类型                        | 说明                          |
| -------------------- | -- | ------------------------- | --------------------------- |
| `WorldContextObject` | 输入 | `UObject*`                | 世界上下文（在 Blueprint 中自动连线）。   |
| `Return value`       | 输出 | `UConvaiObjectComponent*` | 第一个匹配的组件；如果不存在， `nullptr` 。 |
| `OutOwner`           | 输出 | `AActor*`                 | 返回组件所属的 Actor。              |

### 设置访问器

这些节点可读取和写入当前活动实例上的运行时设置： `UConvaiSettings` 。通过 `Set*` 节点所做的更改会立即生效；除非另行保存项目设置，否则这些值不会持久化到 `.ini` 文件中。

| 节点                           | 类别                 | 类型                  | 说明                                                                                                                                |
| ---------------------------- | ------------------ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `SetAPI_Key`                 | `Convai\|Settings` | `BlueprintCallable` | 覆盖用于身份验证的 API 密钥。输入： `API_Key (FString)`.                                                                                         |
| `GetAPI_Key`                 | `Convai\|Settings` | `BlueprintPure`     | 以 `FString`.                                                                                                                      |
| `SetAuthToken`               | `Convai\|Settings` | `BlueprintCallable` | 覆盖身份验证令牌。输入： `AuthToken (FString)`.                                                                                               |
| `GetAuthToken`               | `Convai\|Settings` | `BlueprintPure`     | 以 `FString`.                                                                                                                      |
| `GetTestCharacterID`         | `Convai\|Settings` | `BlueprintPure`     | 返回设置中配置的测试角色 ID。                                                                                                                  |
| `SetCustomParam`             | `Convai\|Settings` | `BlueprintCallable` | 向 `CustomPrams` 设置映射中写入一个键值对。该值通过 `GetCustomParam` 并按以下链路解析：内置默认值 → `CustomPrams` → 命令行覆盖。输入： `Key (FString)`, `Value (FString)`. |
| `GetCustomParam`             | `Convai\|Settings` | `BlueprintPure`     | 使用完整解析链返回 `Key` 对应的解析值。如果解析链得到空字符串，则返回 `DefaultValue` 。输入： `Key (FString)`, `DefaultValue (FString)`。返回值： `FString`.              |
| `GetClientVersion`           | `Convai\|Settings` | `BlueprintPure`     | 返回通过 `ClientVersion` 经由 `CustomPrams` / 命令行解析链解析出的值。返回： `FString`.                                                                |
| `GetVADSettings`             | `Convai\|Settings` | `BlueprintPure`     | 返回当前 `FConvaiVADSettings` 的快照，数据来自项目设置。                                                                                           |
| `SetVADSettings`             | `Convai\|Settings` | `BlueprintCallable` | 覆盖当前活动 `UConvaiSettings` 实例中的 VAD 设置。保存时会写入 `.ini` 文件。输入： `InSettings (FConvaiVADSettings)`.                                      |
| `IsAlwaysAllowVisionEnabled` | `Convai\|Settings` | `BlueprintPure`     | 当 Always Allow Vision 设置启用时，返回 `true` 。                                                                                           |

`FConvaiVADSettings` 字段说明（`bUseServerDefault`, `Confidence`, `StartSecs`, `StopSecs`, `MinVolume`）请参阅 [数据类型和枚举](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/blueprint-reference/data-types-and-enums.md).

### 音频辅助函数

#### `StereoToMono`

类别： `Convai|Utilities`

转换立体声 WAV 字节，并将转换后的单声道 WAV 字节写入输出引脚。

| 引脚               | 方向 | 类型              | 说明               |
| ---------------- | -- | --------------- | ---------------- |
| `stereoWavBytes` | 输入 | `TArray<uint8>` | 原始立体声 WAV 字节数组。  |
| `monoWavBytes`   | 输出 | `TArray<uint8>` | 生成的单声道 WAV 字节数组。 |

#### `WriteSoundWaveToWavFile`

类别： `Convai|Utilities`

将 `USoundWave` 写入磁盘上的 `.wav` 文件。

| 引脚             | 方向 | 类型            | 说明            |
| -------------- | -- | ------------- | ------------- |
| `SoundWave`    | 输入 | `USoundWave*` | 要写入的声音波形资源。   |
| `FilePath`     | 输入 | `FString`     | 输出文件的绝对路径。    |
| `Return value` | 输出 | `bool`        | `成功时返回` true。 |

#### `ReadWavFileAsSoundWave`

类别： `Convai|Utilities` — `BlueprintPure`

读取 `.wav` 文件，并将其作为 `USoundWave`.

| 引脚             | 方向 | 类型            | 说明                      |
| -------------- | -- | ------------- | ----------------------- |
| `FilePath`     | 输入 | `FString`     | 磁盘上 `.wav` 文件的绝对路径。     |
| `Return value` | 输出 | `USoundWave*` | 加载的音波，失败时返回 `nullptr` 。 |

### 文件 I/O

| 节点                    | 返回                              | 说明                                                   |
| --------------------- | ------------------------------- | ---------------------------------------------------- |
| `ReadFileAsByteArray` | `bool`, `Bytes (TArray<uint8>)` | 读取 `FilePath` 指定路径的文件，并将其存入字节数组。失败时返回 `false` 。      |
| `SaveByteArrayAsFile` | `bool`                          | 将 `Bytes` 写入 `FilePath`指定的文件。失败时返回 `false` 。         |
| `ByteArrayToString`   | `FString`                       | 将 `Bytes` 转换为 UTF-8 编码的 `FString`.                   |
| `WriteStringToFile`   | `bool`                          | 将 `StringToWrite` 写入 `FilePath`指定的文件。失败时返回 `false` 。 |
| `ReadStringFromFile`  | `bool`, `OutString (FString)`   | 读取 `FilePath` 到 `OutString`。返回 `false` （失败时）。        |

### Blendshape 实用工具

这些节点用于操作 `TMap<FName, float>` Blendshape 映射，主要用于唇形同步和面部动画流程。有关将 Blendshape 数据发送到角色的节点，请参阅 [Convai 聊天机器人组件](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/blueprint-reference/convai-chatbot-component.md) 。

#### `MapBlendshapes`

类别： `Convai|Blendshapes` — `BlueprintPure`

将 Blendshape 从一种命名约定或骨架映射并转换到另一种。支持为每个 Blendshape 设置乘数、偏移、钳制和覆盖值。

| 引脚                 | 方向 | 类型                                         | 说明                                                              |
| ------------------ | -- | ------------------------------------------ | --------------------------------------------------------------- |
| `InputBlendshapes` | 输入 | `TMap<FName, float>`                       | 源 Blendshape 映射（例如 ARKit 输出）。                                   |
| `BlendshapeMap`    | 输入 | `TMap<FName, FConvaiBlendshapeParameters>` | 每个 Blendshape 的转换配置。每个条目将一个源键映射到一个或多个目标名称，并指定乘数、偏移以及可选的钳制值和覆盖值。 |
| `GlobalMultiplier` | 输入 | `float`                                    | 应用于所有 Blendshape，但以下项除外：已设置 `IgnoreGlobalModifiers` 的项。         |
| `GlobalOffset`     | 输入 | `float`                                    | 添加到所有 Blendshape，但以下项除外：已设置 `IgnoreGlobalModifiers` 的项。         |
| `Return value`     | 输出 | `TMap<FName, float>`                       | 转换后的 Blendshape 映射，可用于目标骨架。                                     |

`FConvaiBlendshapeParameters` 字段说明请参阅 [数据类型和枚举](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/blueprint-reference/data-types-and-enums.md).

#### `SplitBlendshapeMapByKeys`

类别： `Convai|Blendshapes` — `BlueprintCallable` （显示名称： **按键拆分 Blendshape 映射**)

将 Blendshape 映射拆分为两部分：列在 `SplitKeys` 中的键会从 `InOutOriginalMap` 中移除，并放入 `OutSplitMap`。适用于分离需要使用不同混合模式的面部区域。

| 引脚                 | 方向        | 类型                   | 说明               |
| ------------------ | --------- | -------------------- | ---------------- |
| `InOutOriginalMap` | 输入/输出（引用） | `TMap<FName, float>` | 原地修改 — 匹配的键会被移除。 |
| `SplitKeys`        | 输入        | `TArray<FName>`      | 要提取的键。           |
| `OutSplitMap`      | 输出        | `TMap<FName, float>` | 仅包含提取出的键值对。      |

#### `MergeBlendshapeMaps`

类别： `Convai|Blendshapes` — `BlueprintPure` （显示名称 **合并 Blendshape 映射**)

合并两个 blendshape 映射。如果两个映射中存在相同的键，则优先使用 `OverrideMap` 中的值。

| 引脚             | 方向 | 类型                   | 说明                     |
| -------------- | -- | -------------------- | ---------------------- |
| `BaseMap`      | 输入 | `TMap<FName, float>` | 基础 blendshape 值。       |
| `OverrideMap`  | 输入 | `TMap<FName, float>` | 用于覆盖 `BaseMap` 中同键值的值。 |
| `Return value` | 输出 | `TMap<FName, float>` | 合并后的映射。                |

### 骨骼网格体辅助函数

#### `GetBodyAndFaceSkeletalMeshComponents`

类型： `BlueprintCallable` （包含执行引脚）\
类别： `Convai|Utilities`

根据骨骼名称启发式规则，将 Actor 的骨骼网格体组件拆分为身体网格体和面部网格体。适用于 MetaHuman 风格的绑定，其中面部网格体是独立的。

检测规则：

* 0 个骨骼网格体组件：两个输出均为 `nullptr`.
* 恰好 1 个：该网格体作为身体；面部为 `nullptr`.
* 2 个或更多：根据身体标记（`"pelvis"`, `"hand"`, `"neck"`，……）和面部标记（`"eye"`, `"jaw"`, `"brow"`，……）对每个候选项进行评分。得分最高的网格体将用于对应位置。如果没有网格体获得身体评分，则使用层级最浅的骨骼网格体；仅当没有候选项被排序时才使用 `SkelMeshes[0]` 。如果没有网格体获得面部评分， `FaceComponent` 将为 `nullptr`.

| 引脚              | 方向 | 类型                        | 说明                     |
| --------------- | -- | ------------------------- | ---------------------- |
| `Actor`         | 输入 | `AActor*`                 | 要检查的 Actor。            |
| `BodyComponent` | 输出 | `USkeletalMeshComponent*` | 已识别的身体网格体，或 `nullptr`. |
| `FaceComponent` | 输出 | `USkeletalMeshComponent*` | 已识别的面部网格体，或 `nullptr`. |

### 诊断和平台节点

| 节点                                   | 类别                  | 类型              | 返回                                                                            | 说明                                     |
| ------------------------------------ | ------------------- | --------------- | ----------------------------------------------------------------------------- | -------------------------------------- |
| `GetPluginInfo`                      | `Convai\|Utilities` | `BlueprintPure` | `Found (bool)`, `VersionName`, `EngineVersion`, `FriendlyName` (`FString` 各项） | 返回指定插件的元数据。输入： `PluginName (FString)`. |
| `GetPlatformInfo`                    | `Convai\|Utilities` | `BlueprintPure` | `EngineVersion (FString)`, `PlatformName (FString)`                           | 返回正在运行的引擎版本字符串和平台名称。                   |
| `GetDeviceUniqueIdentifier`          | `Convai\|Utilities` | `BlueprintPure` | `FString`                                                                     | 返回平台级唯一设备标识符。                          |
| `GetStreamURL`                       | `Convai\|Utilities` | `BlueprintPure` | `FString`                                                                     | 返回从设置中解析出的流 URL。                       |
| `GetLLMProvider`                     | `Convai\|Utilities` | `BlueprintPure` | `FString`                                                                     | 返回已配置的 LLM 提供方标识符。                     |
| `GetConnectionType`                  | `Convai\|Utilities` | `BlueprintPure` | `FString`                                                                     | 返回已配置的连接类型字符串。                         |
| `GetEmotionsProvider`                | `Convai\|Utilities` | `BlueprintPure` | `FString`                                                                     | 返回已配置的情绪提供方标识符。                        |
| `IsAECEnabled`                       | `Convai\|Utilities` | `BlueprintPure` | `bool`                                                                        | `true` 当设置中启用了声学回声消除时。                 |
| `GetAECType`                         | `Convai\|Utilities` | `BlueprintPure` | `FString`                                                                     | 返回设置中的 AEC 类型字符串。                      |
| `IsVADEnabled`                       | `Convai\|Utilities` | `BlueprintPure` | `bool`                                                                        | `true` 当设置中启用了语音活动检测时。                 |
| `GetVADMode`                         | `Convai\|Utilities` | `BlueprintPure` | `int32`                                                                       | 返回 VAD 灵敏度模式（0–3）。                     |
| `IsNoiseSuppressionEnabled`          | `Convai\|Utilities` | `BlueprintPure` | `bool`                                                                        | `true` 当设置中启用了噪声抑制时。                   |
| `IsGainControlEnabled`               | `Convai\|Utilities` | `BlueprintPure` | `bool`                                                                        | `true` 当设置中启用了自动增益控制时。                 |
| `IsHighPassFilterEnabled`            | `Convai\|Utilities` | `BlueprintPure` | `bool`                                                                        | `true` 当设置中启用了高通音频滤波器时。                |
| `IsFaceSyncSimulateFreeze`           | `Convai\|Utilities` | `BlueprintPure` | `bool`                                                                        | `true` 当启用 FaceSync 冻结模拟调试模式时。         |
| `GetLipSyncMode`                     | `Convai\|Utilities` | `BlueprintPure` | `EC_LipSyncMode`                                                              | 返回配置的唇形同步模式。                           |
| `GetLipSyncTimeOffset`               | `Convai\|Utilities` | `BlueprintPure` | `double`                                                                      | 返回唇形同步时间偏移量（秒）。                        |
| `GetLipSyncAnimParamOverride`        | `Convai\|Utilities` | `BlueprintPure` | `FString`                                                                     | 返回指定 `Key`.                            |
| `GetLipSyncStarvationFallback`       | `Convai\|Utilities` | `BlueprintPure` | `float`                                                                       | 返回唇形同步管线的饥饿回退时长（秒）。                    |
| `GetConnectionProxyTTL`              | `Convai\|Utilities` | `BlueprintPure` | `float`                                                                       | 返回连接代理的生存时间（秒）。                        |
| `GetPrepConnectionTTL`               | `Convai\|Utilities` | `BlueprintPure` | `float`                                                                       | 返回预准备连接的生存时间（秒）。                       |
| `GetObjectPollIntervalSeconds`       | `Convai\|Utilities` | `BlueprintPure` | `float`                                                                       | 返回对象组件轮询周期之间的间隔（秒）。                    |
| `GetClientReadyRetrySecs`            | `Convai\|Utilities` | `BlueprintPure` | `float`                                                                       | 返回等待客户端就绪信号时使用的重试间隔（秒）。                |
| `GetClientReadyTimeoutSecs`          | `Convai\|Utilities` | `BlueprintPure` | `float`                                                                       | 返回客户端就绪握手的超时时间（秒）。                     |
| `GetContextDebounceWindowDefault`    | `Convai\|Utilities` | `BlueprintPure` | `float`                                                                       | 返回上下文更新的默认防抖窗口时长（秒）。                   |
| `GetContextMaxDebounceWindowDefault` | `Convai\|Utilities` | `BlueprintPure` | `float`                                                                       | 返回上下文更新的最大防抖窗口时长（秒）。                   |

`EC_LipSyncMode` 相关值请参阅 [数据类型和枚举](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/blueprint-reference/data-types-and-enums.md).

### 命令行工具

`UCommandLineUtils` 是同一模块中的第二个蓝图函数库。其节点位于 **CommandLine** 类别中。使用这些节点可在运行时读取命令行参数值，以进行调试覆盖和测试自动化，而无需重新编译。

| 节点                                         | 类型                                   | 返回        | 说明                                                        |
| ------------------------------------------ | ------------------------------------ | --------- | --------------------------------------------------------- |
| `GetCommandLineFlagValueAsInt`             | `BlueprintCallable`                  | `int32`   | 返回命令行中 `Flag` 的整数值。若该标志不存在，则返回 `DefaultValue` （默认值 `0`）。  |
| `GetCommandLineFlagValueAsString`          | `BlueprintCallable`                  | `FString` | 返回命令行中 `Flag`的字符串值。若该标志不存在，则返回 `DefaultValue` （默认值 `""`）。 |
| `GetCommandLineFlagValueAsStringNoDefault` | `BlueprintCallable`, `BlueprintPure` | `FString` | 返回 `Flag` 的字符串值，且不提供默认参数。                                 |
| `GetCommandLineFlagValueAsDouble`          | `BlueprintCallable`, `BlueprintPure` | `double`  | 返回 `Flag`的双精度值。若标志不存在，则返回 `DefaultValue` （默认 `0.0`）。      |

### 连接管理

`UConvaiConnectionLibrary` 提供 `PrepareCharacterConnection` 蓝图节点，位于 `Convai|Connection` 类别中。它会预热角色连接，以便稍后由 `StartSession`复用；连接工作流程请参阅 [会话生命周期](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/core-concepts/session-lifecycle.md) ， [数据类型和枚举](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/blueprint-reference/data-types-and-enums.md) 中介绍了 `EC_PrepResult` 的取值。

| 引脚                       | 方向 | 类型              | 说明                                                |
| ------------------------ | -- | --------------- | ------------------------------------------------- |
| `WorldContextObject`     | 输入 | `UObject*`      | 世界上下文（在 Blueprint 中自动连线）。                         |
| `CharacterID`            | 输入 | `FString`       | 要预热的角色 ID。                                        |
| `PrepTTLOverrideSeconds` | 输入 | `float`         | 可选的预热时长。默认情况下， `0.0` 使用项目设置；正值会限制在 `1`–`600` 秒之间。 |
| `Return value`           | 输出 | `EC_PrepResult` | 预热请求的结果。                                          |

### 相关参考

聊天机器人组件是混合形状和注视目标实用节点的主要使用者；玩家组件则使用组件查找和麦克风辅助工具。

{% content-ref url="/pages/4a6e5ee0afdb709983f0b5685e8cf00febcf5282" %}
[Convai 聊天机器人组件](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/blueprint-reference/convai-chatbot-component.md)
{% endcontent-ref %}

{% content-ref url="/pages/7882b4c0154c419a4eb6df2db3b2035b55cacb03" %}
[Convai 玩家组件](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/blueprint-reference/convai-player-component.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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/blueprint-reference/convai-utility-functions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
