# 条件

{% hint style="info" %}

### 逻辑-条件组件

{% endhint %}

<figure><img src="/files/32o4hj8wjrOP4gobVhXe" alt="" width="292"><figcaption></figcaption></figure>

{% hint style="info" %}
你可以用条件组件，根据判断的形式，分别走向不同的路径
{% endhint %}

例如：“如果 Score 大于 20，则转到这上面的路径。否则，转到另外一条路径。”

<figure><img src="/files/Gd9A0Ipa95d6Lop4LIsL" alt="" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
条件可以包含不同的比较，这些比较按顺序求值，并与逻辑运算符“and”或“or”相关联。
{% endhint %}

### **运算符**

#### **Equal to（等于）**

如果提供的值严格等于该值，则将匹配<br>

#### **Not equal（不等于）**

如果提供的值不等于该值，则将匹配<br>

#### **Contains（包含）**

如果提供的值包含该值，则将匹配。如果提供了一个列表，如果该列表至少有一个与该值相同的元素，则它将匹配。<br>

#### **Does not contain（不包含）**

与`Contains`相同，但会匹配相反的结果<br>

#### **Greater than（大于）**

如果提供的值大于或等于该值，则匹配。<br>

#### **Less than（小于）**

如果提供的值小于或等于该值，则将匹配。<br>

#### **Is set（不为空）**

如果提供的值不为 null 或未定义且不是空字符串，则将匹配<br>

#### **Is empty（为空）**

如果提供的值为空、未定义或空字符串，将匹配。<br>

#### **Starts with（以..开始）**

如果提供的值以该值开头，则将匹配<br>

#### **Ends with（以..结尾）**

如果提供的值以该值结尾，则将匹配。<br>

#### **Matches regex（匹配正则表达式）**

值应以有效的正则表达式模式开头和结尾`/`并包含有效的正则表达式模式。

* `/^hello$/`如果字符串严格等于“hello”，则匹配。
* `/hello/`如果字符串包含“hello”，则匹配。就像“你好世界”。
* `/hello/i`如果字符串包含“hello”，则匹配（不区分大小写）。就像“你好世界”。
* `/[0-9]+/`如果字符串包含一位或多位数字，则将匹配。比如“123”

#### **Does not match regex（与正则表达式不匹配）**

与`Matches regex`相同，但如果提供的值与正则表达式模式不匹配，则将匹配


---

# Agent Instructions: 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:

```
GET https://doc.nyai.chat/jin-jie-jiao-cheng-gong-zuo-liu/luo-ji-zu-jian/tiao-jian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
