UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

15 lines (14 loc) 489 B
//#region src/agents/content-blocks.ts /** Collects text block payloads from provider-style structured content arrays. */ function collectTextContentBlocks(content) { if (!Array.isArray(content)) return []; const parts = []; for (const block of content) { if (!block || typeof block !== "object") continue; const rec = block; if (rec.type === "text" && typeof rec.text === "string") parts.push(rec.text); } return parts; } //#endregion export { collectTextContentBlocks as t };