Skip to content

Commit cbe21cb

Browse files
quanruclaudeyuyutaotao
authored
docs(yaml): add global agent configuration for aiActionContext (#1260)
* docs(yaml): add global agent configuration for aiActionContext - Add global agent configuration section to both EN and ZH docs - Move aiActionContext from web-specific to global agent config - Provide unified configuration approach for all environments (Web, iOS, Android) - Include usage examples with iOS and Android configurations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * docs(site): fix tip syntax * docs(core): update yaml intro --------- Co-authored-by: Claude <[email protected]> Co-authored-by: yutao <[email protected]>
1 parent 9482c2d commit cbe21cb

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

apps/site/docs/en/automate-with-scripts-in-yaml.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,50 @@ web:
174174

175175
# Whether to ignore HTTPS certificate errors, optional, defaults to false.
176176
acceptInsecureCerts: <boolean>
177+
```
178+
179+
### Global agent configuration
180+
181+
If you need to use the `aiActionContext` parameter, you can set it through the global `agent` configuration:
177182

183+
```yaml
184+
# Global AI agent configuration
185+
agent:
178186
# Background knowledge to send to the AI model when calling aiAction, optional.
179187
aiActionContext: <string>
180188
```
181189

190+
:::tip aiActionContext configuration
191+
192+
- **Applicable environments**: Web, iOS, and Android environments can all use the global `agent` configuration to set `aiActionContext`
193+
- **Purpose**: Provides background knowledge to the AI model, like how to handle popups, business introduction, etc.
194+
195+
:::
196+
197+
#### Usage example
198+
199+
```yaml
200+
# Global agent configuration, applies to all environments
201+
agent:
202+
aiActionContext: "If any popup appears, click agree. If login page appears, skip it."
203+
204+
# iOS environment configuration
205+
ios:
206+
launch: https://www.bing.com
207+
wdaPort: 8100
208+
209+
# Or Android environment configuration
210+
android:
211+
deviceId: s4ey59
212+
launch: https://www.bing.com
213+
214+
tasks:
215+
- name: Search for weather
216+
flow:
217+
- ai: Search for "today's weather"
218+
- aiAssert: The results show weather information
219+
```
220+
182221
### The `android` part
183222

184223
```yaml

apps/site/docs/zh/automate-with-scripts-in-yaml.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,50 @@ web:
174174

175175
# 是否忽略 HTTPS 证书错误,可选,默认 false
176176
acceptInsecureCerts: <boolean>
177+
```
178+
179+
### 全局 agent 配置
180+
181+
如需使用 `aiActionContext` 参数,可以通过全局的 `agent` 配置来设置:
177182

183+
```yaml
184+
# 全局 AI agent 配置
185+
agent:
178186
# 在调用 aiAction 时发送给 AI 模型的背景知识,可选
179187
aiActionContext: <string>
180188
```
181189

190+
:::tip aiActionContext 配置说明
191+
192+
- **适用环境**:Web、iOS 和 Android 环境都可以通过全局的 `agent` 配置来设置 `aiActionContext`
193+
- **作用**:为 AI 模型提供背景知识,例如处理弹窗、业务介绍等常见场景
194+
195+
:::
196+
197+
#### 使用示例
198+
199+
```yaml
200+
# 全局 agent 配置,适用于所有环境
201+
agent:
202+
aiActionContext: "如果出现弹窗,点击同意。如果出现登录页面,跳过它。"
203+
204+
# iOS 环境配置
205+
ios:
206+
launch: https://www.bing.com
207+
wdaPort: 8100
208+
209+
# 或 Android 环境配置
210+
android:
211+
deviceId: s4ey59
212+
launch: https://www.bing.com
213+
214+
tasks:
215+
- name: 搜索天气
216+
flow:
217+
- ai: 搜索 "今日天气"
218+
- aiAssert: 结果显示天气信息
219+
```
220+
182221
### `android` 部分
183222

184223
```yaml

0 commit comments

Comments
 (0)