> 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/unreal-engine/guides/operations-based-on-the-presence-of-certain-words.md). Agents can also search and read this documentation through its [MCP server](https://docs.convai.com/api-docs/~gitbook/mcp).

# 基于特定词语存在的操作

本文档解释了如何检测词语并基于其执行某些操作。

* 打开您的 Convai 角色蓝图，然后点击 `Class Settings` ，然后点击 `ConvaiChatbot` 组件。
* 在 `Details` 部分向下滚动到 `Events` 部分，并添加 `On Transcription Received` 事件。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FzyMcLBkNbr0kBGcYBfow%2FWordDetection.jpg?alt=media&amp;token=5c0fa21d-7d79-4d8d-be6d-ecfe2c6a5dcb" alt=""><figcaption><p>将 On Transcription Received 事件添加到事件图表。</p></figcaption></figure>

* 获取玩家输入的转录文本后，我们可以对其进行子字符串搜索。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FkKqWcNlBtMgkux7rE6RZ%2Fimage.png?alt=media&amp;token=2f159093-fc56-4972-b7c6-ff443ce813c8" alt=""><figcaption><p>对转录文本进行子字符串搜索。</p></figcaption></figure>

{% hint style="info" %}
末尾的 Print String 仅为示例。您可以在子字符串匹配后添加自己的逻辑。
{% endhint %}


---

# 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/unreal-engine/guides/operations-based-on-the-presence-of-certain-words.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.
