From 256a5d1713f87bfe8df7a4dd7cf3e758496c9dca Mon Sep 17 00:00:00 2001 From: "openclaw-docs-sync[bot]" Date: Thu, 23 Apr 2026 02:36:25 +0000 Subject: [PATCH] chore(sync): mirror docs from openclaw/openclaw@0e7bcf7588d279e68e866664551d5a2da7c58864 --- .openclaw-sync/source.json | 4 +-- .../.generated/plugin-sdk-api-baseline.sha256 | 4 +-- docs/plugins/sdk-migration.md | 2 +- docs/plugins/sdk-overview.md | 2 +- docs/plugins/sdk-provider-plugins.md | 34 +++++++++++++++---- 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/.openclaw-sync/source.json b/.openclaw-sync/source.json index 82d3af2ba..dcfd76d5d 100644 --- a/.openclaw-sync/source.json +++ b/.openclaw-sync/source.json @@ -1,5 +1,5 @@ { "repository": "openclaw/openclaw", - "sha": "b09aed827147508f1b3befcc9c71a59d9d19ad6b", - "syncedAt": "2026-04-23T02:33:25.151Z" + "sha": "0e7bcf7588d279e68e866664551d5a2da7c58864", + "syncedAt": "2026-04-23T02:36:25.192Z" } diff --git a/docs/.generated/plugin-sdk-api-baseline.sha256 b/docs/.generated/plugin-sdk-api-baseline.sha256 index 81e57d732..01df532b2 100644 --- a/docs/.generated/plugin-sdk-api-baseline.sha256 +++ b/docs/.generated/plugin-sdk-api-baseline.sha256 @@ -1,2 +1,2 @@ -2b7093a57992029cc70126d33544e02eed6c3076a3a6b4ffa6aef7664da0f33d plugin-sdk-api-baseline.json -ea6a2f2326565517b6c42a4d334f615163fb434dbad5e0b8d134c92767714256 plugin-sdk-api-baseline.jsonl +e10f01ce10a381ecb098b805cee95b7278d16de42e02c7873f54448eb2b6c5cc plugin-sdk-api-baseline.json +918b646ff2e0849c4feba5ef930a08187a7bdad3a2d35ba4e1dd456fe3ea2cea plugin-sdk-api-baseline.jsonl diff --git a/docs/plugins/sdk-migration.md b/docs/plugins/sdk-migration.md index aae3e2f4b..ced0f07f5 100644 --- a/docs/plugins/sdk-migration.md +++ b/docs/plugins/sdk-migration.md @@ -296,7 +296,7 @@ Current bundled provider examples: | `plugin-sdk/text-chunking` | Text chunking helpers | Outbound text chunking helper | | `plugin-sdk/speech` | Speech helpers | Speech provider types plus provider-facing directive, registry, and validation helpers | | `plugin-sdk/speech-core` | Shared speech core | Speech provider types, registry, directives, normalization | - | `plugin-sdk/realtime-transcription` | Realtime transcription helpers | Provider types and registry helpers | + | `plugin-sdk/realtime-transcription` | Realtime transcription helpers | Provider types, registry helpers, and shared WebSocket session helper | | `plugin-sdk/realtime-voice` | Realtime voice helpers | Provider types and registry helpers | | `plugin-sdk/image-generation-core` | Shared image-generation core | Image-generation types, failover, auth, and registry helpers | | `plugin-sdk/music-generation` | Music-generation helpers | Music-generation provider/request/result types | diff --git a/docs/plugins/sdk-overview.md b/docs/plugins/sdk-overview.md index 60c815a94..5ce0e772c 100644 --- a/docs/plugins/sdk-overview.md +++ b/docs/plugins/sdk-overview.md @@ -258,7 +258,7 @@ explicitly promotes one as public. | `plugin-sdk/text-chunking` | Outbound text chunking helper | | `plugin-sdk/speech` | Speech provider types plus provider-facing directive, registry, and validation helpers | | `plugin-sdk/speech-core` | Shared speech provider types, registry, directive, and normalization helpers | - | `plugin-sdk/realtime-transcription` | Realtime transcription provider types and registry helpers | + | `plugin-sdk/realtime-transcription` | Realtime transcription provider types, registry helpers, and shared WebSocket session helper | | `plugin-sdk/realtime-voice` | Realtime voice provider types and registry helpers | | `plugin-sdk/image-generation` | Image generation provider types | | `plugin-sdk/image-generation-core` | Shared image-generation types, failover, auth, and registry helpers | diff --git a/docs/plugins/sdk-provider-plugins.md b/docs/plugins/sdk-provider-plugins.md index 03c68fd10..07d8d24f5 100644 --- a/docs/plugins/sdk-provider-plugins.md +++ b/docs/plugins/sdk-provider-plugins.md @@ -599,12 +599,34 @@ API key auth, and dynamic model resolution. id: "acme-ai", label: "Acme Realtime Transcription", isConfigured: () => true, - createSession: (req) => ({ - connect: async () => {}, - sendAudio: () => {}, - close: () => {}, - isConnected: () => true, - }), + createSession: (req) => { + const apiKey = String(req.providerConfig.apiKey ?? ""); + return createRealtimeTranscriptionWebSocketSession({ + providerId: "acme-ai", + callbacks: req, + url: "wss://api.example.com/v1/realtime-transcription", + headers: { Authorization: `Bearer ${apiKey}` }, + onMessage: (event, transport) => { + if (event.type === "session.created") { + transport.sendJson({ type: "session.update" }); + transport.markReady(); + return; + } + if (event.type === "transcript.final") { + req.onTranscript?.(event.text); + } + }, + sendAudio: (audio, transport) => { + transport.sendJson({ + type: "audio.append", + audio: audio.toString("base64"), + }); + }, + onClose: (transport) => { + transport.sendJson({ type: "audio.end" }); + }, + }); + }, }); api.registerRealtimeVoiceProvider({