Ringkasan Provider Messaging
Pendahuluan
Section titled “Pendahuluan”Greentic mendukung beberapa platform messaging melalui Messaging Providers. Setiap provider adalah pack komponen WASM yang menangani:
- Ingress - Menerima pesan dari platform
- Egress - Mengirim pesan ke platform
- Operations - Fitur spesifik platform (tombol, card, thread)
Provider yang Tersedia
Section titled “Provider yang Tersedia” Slack Terhubung ke workspace Slack dengan dukungan app penuh
Microsoft Teams Integrasikan dengan channel dan chat Microsoft Teams
Telegram Bangun bot Telegram dengan tombol dan inline keyboard
WhatsApp Terhubung ke WhatsApp Business API
WebChat Sematkan widget chat di situs web Anda
Webex Integrasikan dengan Cisco Webex Teams
Email Kirim dan terima email sebagai pesan
Arsitektur
Section titled “Arsitektur”External Platform (Slack/Teams/Telegram) │ ▼ Webhook┌─────────────────────────────────────────┐│ Ingress Component ││ (Parse platform-specific format) │└─────────────────────────────────────────┘ │ ▼ Normalized Message┌─────────────────────────────────────────┐│ NATS Bus ││ greentic.messaging.ingress.{tenant}... │└─────────────────────────────────────────┘ │ ▼┌─────────────────────────────────────────┐│ Flow Executor ││ (Process with your flows) │└─────────────────────────────────────────┘ │ ▼┌─────────────────────────────────────────┐│ NATS Bus ││ greentic.messaging.egress.{tenant}... │└─────────────────────────────────────────┘ │ ▼ Platform-specific format┌─────────────────────────────────────────┐│ Egress Component ││ (Format for platform API) │└─────────────────────────────────────────┘ │ ▼ API CallExternal PlatformNormalisasi Pesan
Section titled “Normalisasi Pesan”Semua provider menormalisasi pesan ke format umum:
pub struct NormalizedMessage { pub id: String, pub channel_id: String, pub sender_id: String, pub sender_name: Option<String>, pub content: String, pub timestamp: u64, pub reply_to: Option<String>, pub attachments: Vec<Attachment>, pub metadata: Option<Value>,}Ini memungkinkan flow Anda bekerja di berbagai platform messaging tanpa modifikasi.
Konfigurasi Provider
Section titled “Konfigurasi Provider”Di Bundle
Section titled “Di Bundle”providers: messaging-telegram: pack: "providers/messaging/messaging-telegram.gtpack" setup_flow: "setup_default" verify_flow: "verify_webhooks"
messaging-slack: pack: "providers/messaging/messaging-slack.gtpack" setup_flow: "setup_default"Setup Answers
Section titled “Setup Answers”{ "messaging-telegram": { "enabled": true, "public_base_url": "https://example.ngrok-free.app", "bot_token": "123456789:ABCdefGHI..." }, "messaging-slack": { "enabled": true, "public_base_url": "https://example.ngrok-free.app", "bot_token": "xoxb-xxx-xxx", "slack_app_id": "A07XXX" }}Subject NATS
Section titled “Subject NATS”Pesan mengalir melalui NATS dengan subject berskala tenant:
| Subject | Arah |
|---|---|
greentic.messaging.ingress.{env}.{tenant}.{team}.{channel} | Masuk |
greentic.messaging.egress.{env}.{tenant}.{team}.{channel} | Keluar |
Fitur Umum
Section titled “Fitur Umum”Pesan Teks
Section titled “Pesan Teks”Semua provider mendukung pesan teks dasar:
- id: reply type: reply config: message: "Hello! How can I help?"Konten Kaya
Section titled “Konten Kaya”Sebagian besar provider mendukung konten kaya:
- id: send_card type: adaptive-card config: card: "cards/welcome.json"Tombol/Aksi
Section titled “Tombol/Aksi”Elemen interaktif (bergantung pada provider):
- id: ask_choice type: reply config: message: "What would you like to do?" buttons: - label: "Get Help" action: "help" - label: "Contact Support" action: "support"Lampiran
Section titled “Lampiran”Dukungan file dan media:
- id: send_file type: reply config: message: "Here's your report" attachments: - type: file url: "https://example.com/report.pdf" name: "report.pdf"Flow Multi-Channel
Section titled “Flow Multi-Channel”Tulis flow yang bekerja lintas channel:
name: universal_handlerversion: "1.0"
nodes: - id: greet type: reply config: # Works on any platform message: "Hello! I'm your assistant." next: ask_intent
- id: ask_intent type: reply config: message: "How can I help you today?" # Buttons render differently per platform buttons: - label: "Get Started" action: "start" - label: "Help" action: "help"
triggers: - type: message pattern: "hello|hi" target: greetPerbandingan Provider
Section titled “Perbandingan Provider”| Fitur | Slack | Teams | Telegram | WebChat | Webex | ||
|---|---|---|---|---|---|---|---|
| Teks | Ya | Ya | Ya | Ya | Ya | Ya | Ya |
| Rich Card | Ya | Ya | Sebagian | Ya | Ya | Ya | Tidak |
| Tombol | Ya | Ya | Ya | Ya | Ya | Ya | Tidak |
| File | Ya | Ya | Ya | Ya | Ya | Ya | Ya |
| Thread | Ya | Ya | Ya | Tidak | Tidak | Ya | Ya |
| Reaksi | Ya | Ya | Tidak | Ya | Tidak | Tidak | Tidak |
Langkah Berikutnya
Section titled “Langkah Berikutnya”Pilih provider untuk mulai: