translation/translated/documents/course/04-workflows/07-using-playground.md

59 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 使用操练场
Mastra操练场提供了可视界面来测试和运行您的工作流。让我们看看您的工作流运行效果
## 启动开发服务器
使用 `mastra dev` 命令启动您的Mastra开发服务器。如果您使用npm命令是
```bash
npm run dev
```
您应该看到如下输出:
```bash
🚀 Mastra Dev Server starting...
📊 Studio available at: http://localhost:4111
```
## 在操练场中访问工作流
1. 打开您的浏览器并转到 `http://localhost:4111`
2. 在导航中点击"Workflows"
3. 您应该看到您的 `contentWorkflow` 列在列表中
## 测试您的工作流
1. 点击您的 `contentWorkflow`
2. 您将看到一个基于您工作流输入模式的输入表单
3. 在表单中输入一些测试内容:
```json
{
"content": "Machine learning is revolutionizing healthcare by enabling faster diagnoses and personalized treatments.",
"type": "article"
}
```
4. 点击"Run Workflow"
5. 查看执行进度并查看结果
## 理解界面
操练场向您显示:
- **输入模式**:您的工作流期望的数据
- **执行进度**:步骤完成时的实时更新
- **输出**:您工作流的最终结果
- **执行时间**:工作流运行所需的时间
## 操练场的优势
- **可视化测试**:无需编写代码即可轻松测试工作流
- **模式验证**:从您的模式自动生成表单
- **实时反馈**:在执行过程中准确查看正在发生的事情
- **轻松调试**:快速测试不同输入并查看工作流运行的追踪
很好!您现在可以可视化地测试您的工作流。接下来,您将学习如何以编程方式运行工作流。