コンテンツにスキップ

gtc wizard

gtc wizard コマンドは、wizard の回答から新しい Greentic bundles を作成します。設定ファイル、provider のセットアップ、app templates を含む完全な bundle 構造を scaffold します。

Terminal window
gtc wizard [OPTIONS]
Option説明
--answers <FILE | URL>wizard の回答ファイル(JSON または YAML)へのパスまたは URL。ローカルパスとリモートの http:// / https:// URLs をサポートします。
--dry-run書き込まずに生成されるファイルをプレビューする
--output <DIR>出力ディレクトリ(デフォルト: current directory)
--template <NAME>特定の template を使う
-v, --verbose詳細出力を有効にする
wizard-answers.json
{
"project": {
"name": "my-digital-worker",
"version": "1.0.0",
"description": "Customer support digital worker"
},
"providers": {
"messaging": ["telegram", "slack"],
"events": ["webhook", "timer"]
},
"apps": [
{
"name": "support-bot",
"template": "customer-service"
}
],
"tenants": [
{
"id": "demo",
"name": "Demo Tenant",
"teams": [
{
"id": "default",
"channels": ["telegram", "slack"]
}
]
}
]
}
wizard-answers.yaml
project:
name: my-digital-worker
version: "1.0.0"
description: Customer support digital worker
providers:
messaging:
- telegram
- slack
events:
- webhook
- timer
apps:
- name: support-bot
template: customer-service
tenants:
- id: demo
name: Demo Tenant
teams:
- id: default
channels:
- telegram
- slack

wizard を実行すると、次が生成されます:

my-digital-worker/
├── greentic.demo.yaml # Main configuration
├── providers/
│ ├── messaging/
│ │ ├── messaging-telegram.gtpack
│ │ └── messaging-slack.gtpack
│ └── events/
│ ├── events-webhook.gtpack
│ └── events-timer.gtpack
├── apps/
│ └── support-bot/
│ ├── app.yaml
│ └── flows/
│ └── on_message.ygtc
├── tenants/
│ └── demo/
│ ├── tenant.gmap
│ └── teams/
│ └── default/
│ └── team.gmap
└── seeds.yaml
Terminal window
# Interactive mode
gtc wizard
# With answers file
gtc wizard --answers wizard-answers.yaml
Terminal window
# See what would be generated
gtc wizard --answers wizard-answers.yaml --dry-run

--answers フラグは http://https:// URLs を受け付けるため、共有の回答ドキュメントを中央の場所に保存し、CI/CD パイプラインから参照しやすくなります。

Terminal window
# Fetch answers from a remote URL
gtc wizard --answers https://config.example.com/teams/support/wizard-answers.yaml
# Combine with dry-run to preview before generating
gtc wizard --answers https://config.example.com/teams/support/wizard-answers.yaml --dry-run
Terminal window
gtc wizard --answers wizard-answers.yaml --output ./my-project
Terminal window
# List available templates
gtc wizard --list-templates
# Use specific template
gtc wizard --template customer-service --answers answers.yaml
Template説明
minimal1 つの provider を持つ最小構成の bundle
customer-serviceエスカレーション付き FAQ bot
helpdeskチケット連携付き IT サポート
multi-channel複数の messaging channels
  1. 回答ファイルを作成する

    JSON または YAML でプロジェクト設定を定義します。

  2. wizard を実行する

    Terminal window
    gtc wizard --answers wizard-answers.yaml
  3. 生成されたファイルを確認する

    生成された bundle 構造を確認します。

  4. providers を設定する

    Terminal window
    gtc setup ./my-digital-worker
  5. runtime を起動する

    Terminal window
    gtc start ./my-digital-worker

生成された Flows のカスタマイズ

Section titled “生成された Flows のカスタマイズ”

wizard は基本的な flow templates を生成します。生成後に必要に応じてカスタマイズしてください:

apps/support-bot/flows/on_message.ygtc
name: on_message
version: "1.0"
description: Handle incoming messages
nodes:
# Add your custom nodes here
- id: analyze
type: llm
config:
model: "gpt-4"
prompt: "Analyze: {{message}}"
next: respond
- id: respond
type: reply
config:
message: "{{analysis_result}}"
triggers:
- type: message