{"id":106,"date":"2026-03-21T22:47:17","date_gmt":"2026-03-21T14:47:17","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/concepts-streaming\/"},"modified":"2026-03-21T23:08:51","modified_gmt":"2026-03-21T15:08:51","slug":"concepts-streaming","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/concepts-streaming\/","title":{"rendered":"\u6d41\u5f0f\u4f20\u8f93\u548c\u5206\u5757"},"content":{"rendered":"<h1>\u6d41\u5f0f\u4f20\u8f93\u548c\u5206\u5757<\/h1>\n<h1>\u6d41\u5f0f\u4f20\u8f93 + \u5206\u5757<\/h1>\n<p>OpenClaw \u6709\u4e24\u4e2a\u72ec\u7acb\u7684&#8221;\u6d41\u5f0f\u4f20\u8f93&#8221;\u5c42\uff1a<\/p>\n<ul>\n<li><strong>\u5206\u5757\u6d41\u5f0f\u4f20\u8f93\uff08\u6e20\u9053\uff09\uff1a<\/strong> \u5728\u52a9\u624b\u5199\u5165\u65f6\u53d1\u51fa\u5df2\u5b8c\u6210\u7684<strong>\u5757<\/strong>\u3002\u8fd9\u4e9b\u662f\u666e\u901a\u7684\u6e20\u9053\u6d88\u606f\uff08\u4e0d\u662f\u4ee4\u724c\u589e\u91cf\uff09\u3002<\/li>\n<li><strong>\u7c7b\u4ee4\u724c\u6d41\u5f0f\u4f20\u8f93\uff08\u4ec5\u9650 Telegram\uff09\uff1a<\/strong> \u5728\u751f\u6210\u65f6\u7528\u90e8\u5206\u6587\u672c\u66f4\u65b0<strong>\u8349\u7a3f\u6c14\u6ce1<\/strong>\uff1b\u6700\u7ec8\u6d88\u606f\u5728\u7ed3\u675f\u65f6\u53d1\u9001\u3002<\/li>\n<\/ul>\n<p>\u76ee\u524d<strong>\u6ca1\u6709\u771f\u6b63\u7684\u4ee4\u724c\u6d41\u5f0f\u4f20\u8f93<\/strong>\u5230\u5916\u90e8\u6e20\u9053\u6d88\u606f\u3002Telegram \u8349\u7a3f\u6d41\u5f0f\u4f20\u8f93\u662f\u552f\u4e00\u7684\u90e8\u5206\u6d41\u5f0f\u4f20\u8f93\u754c\u9762\u3002<\/p>\n<h2>\u5206\u5757\u6d41\u5f0f\u4f20\u8f93\uff08\u6e20\u9053\u6d88\u606f\uff09<\/h2>\n<p>\u5206\u5757\u6d41\u5f0f\u4f20\u8f93\u5728\u52a9\u624b\u8f93\u51fa\u53ef\u7528\u65f6\u4ee5\u7c97\u7c92\u5ea6\u5757\u53d1\u9001\u3002<\/p>\n<pre><code>\u6a21\u578b\u8f93\u51fa\n  \u2514\u2500 text_delta\/events\n       \u251c\u2500 (blockStreamingBreak=text_end)\n       \u2502    \u2514\u2500 \u5206\u5757\u5668\u5728\u7f13\u51b2\u533a\u589e\u957f\u65f6\u53d1\u51fa\u5757\n       \u2514\u2500 (blockStreamingBreak=message_end)\n            \u2514\u2500 \u5206\u5757\u5668\u5728 message_end \u65f6\u5237\u65b0\n                   \u2514\u2500 \u6e20\u9053\u53d1\u9001\uff08\u5757\u56de\u590d\uff09\n<\/code><\/pre>\n<p>\u56fe\u4f8b\uff1a<\/p>\n<ul>\n<li><code>text_delta\/events<\/code>\uff1a\u6a21\u578b\u6d41\u4e8b\u4ef6\uff08\u5bf9\u4e8e\u975e\u6d41\u5f0f\u6a21\u578b\u53ef\u80fd\u7a00\u758f\uff09\u3002<\/li>\n<li><code>chunker<\/code>\uff1a\u5e94\u7528\u6700\u5c0f\/\u6700\u5927\u8fb9\u754c + \u65ad\u70b9\u504f\u597d\u7684 <code>EmbeddedBlockChunker<\/code>\u3002<\/li>\n<li><code>channel send<\/code>\uff1a\u5b9e\u9645\u7684\u51fa\u7ad9\u6d88\u606f\uff08\u5757\u56de\u590d\uff09\u3002<\/li>\n<\/ul>\n<p><strong>\u63a7\u5236\u9879\uff1a<\/strong><\/p>\n<ul>\n<li><code>agents.defaults.blockStreamingDefault<\/code>\uff1a<code>\"on\"<\/code>\/<code>\"off\"<\/code>\uff08\u9ed8\u8ba4\u5173\u95ed\uff09\u3002<\/li>\n<li>\u6e20\u9053\u8986\u76d6\uff1a<code>*.blockStreaming<\/code>\uff08\u4ee5\u53ca\u6bcf\u8d26\u6237\u53d8\u4f53\uff09\u53ef\u4e3a\u6bcf\u4e2a\u6e20\u9053\u5f3a\u5236\u8bbe\u7f6e <code>\"on\"<\/code>\/<code>\"off\"<\/code>\u3002<\/li>\n<li><code>agents.defaults.blockStreamingBreak<\/code>\uff1a<code>\"text_end\"<\/code> \u6216 <code>\"message_end\"<\/code>\u3002<\/li>\n<li><code>agents.defaults.blockStreamingChunk<\/code>\uff1a<code>{ minChars, maxChars, breakPreference? }<\/code>\u3002<\/li>\n<li><code>agents.defaults.blockStreamingCoalesce<\/code>\uff1a<code>{ minChars?, maxChars?, idleMs? }<\/code>\uff08\u53d1\u9001\u524d\u5408\u5e76\u6d41\u5f0f\u5757\uff09\u3002<\/li>\n<li>\u6e20\u9053\u786c\u4e0a\u9650\uff1a<code>*.textChunkLimit<\/code>\uff08\u4f8b\u5982 <code>channels.whatsapp.textChunkLimit<\/code>\uff09\u3002<\/li>\n<li>\u6e20\u9053\u5206\u5757\u6a21\u5f0f\uff1a<code>*.chunkMode<\/code>\uff08\u9ed8\u8ba4 <code>length<\/code>\uff0c<code>newline<\/code> \u5728\u957f\u5ea6\u5206\u5757\u4e4b\u524d\u6309\u7a7a\u884c\uff08\u6bb5\u843d\u8fb9\u754c\uff09\u5206\u5272\uff09\u3002<\/li>\n<li>Discord \u8f6f\u4e0a\u9650\uff1a<code>channels.discord.maxLinesPerMessage<\/code>\uff08\u9ed8\u8ba4 17\uff09\u5206\u5272\u9ad8\u5ea6\u8f83\u5927\u7684\u56de\u590d\u4ee5\u907f\u514d UI \u88c1\u526a\u3002<\/li>\n<\/ul>\n<p><strong>\u8fb9\u754c\u8bed\u4e49\uff1a<\/strong><\/p>\n<ul>\n<li><code>text_end<\/code>\uff1a\u5206\u5757\u5668\u53d1\u51fa\u65f6\u7acb\u5373\u6d41\u5f0f\u4f20\u8f93\u5757\uff1b\u5728\u6bcf\u4e2a <code>text_end<\/code> \u65f6\u5237\u65b0\u3002<\/li>\n<li><code>message_end<\/code>\uff1a\u7b49\u5230\u52a9\u624b\u6d88\u606f\u5b8c\u6210\uff0c\u7136\u540e\u5237\u65b0\u7f13\u51b2\u7684\u8f93\u51fa\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u7f13\u51b2\u6587\u672c\u8d85\u8fc7 <code>maxChars<\/code>\uff0c<code>message_end<\/code> \u4ecd\u7136\u4f7f\u7528\u5206\u5757\u5668\uff0c\u56e0\u6b64\u53ef\u80fd\u5728\u6700\u540e\u53d1\u51fa\u591a\u4e2a\u5757\u3002<\/p>\n<h2>\u5206\u5757\u7b97\u6cd5\uff08\u4f4e\/\u9ad8\u8fb9\u754c\uff09<\/h2>\n<p>\u5757\u5206\u5757\u7531 <code>EmbeddedBlockChunker<\/code> \u5b9e\u73b0\uff1a<\/p>\n<ul>\n<li><strong>\u4f4e\u8fb9\u754c\uff1a<\/strong> \u5728\u7f13\u51b2\u533a &gt;= <code>minChars<\/code> \u4e4b\u524d\u4e0d\u53d1\u51fa\uff08\u9664\u975e\u5f3a\u5236\uff09\u3002<\/li>\n<li><strong>\u9ad8\u8fb9\u754c\uff1a<\/strong> \u4f18\u5148\u5728 <code>maxChars<\/code> \u4e4b\u524d\u5206\u5272\uff1b\u5982\u679c\u5f3a\u5236\uff0c\u5219\u5728 <code>maxChars<\/code> \u5904\u5206\u5272\u3002<\/li>\n<li><strong>\u65ad\u70b9\u504f\u597d\uff1a<\/strong> <code>paragraph<\/code> \u2192 <code>newline<\/code> \u2192 <code>sentence<\/code> \u2192 <code>whitespace<\/code> \u2192 \u786c\u65ad\u70b9\u3002<\/li>\n<li><strong>\u4ee3\u7801\u56f4\u680f\uff1a<\/strong> \u4ece\u4e0d\u5728\u56f4\u680f\u5185\u5206\u5272\uff1b\u5f53\u5728 <code>maxChars<\/code> \u5904\u5f3a\u5236\u5206\u5272\u65f6\uff0c\u5173\u95ed + \u91cd\u65b0\u6253\u5f00\u56f4\u680f\u4ee5\u4fdd\u6301 Markdown \u6709\u6548\u3002<\/li>\n<\/ul>\n<p><code>maxChars<\/code> \u88ab\u9650\u5236\u5728\u6e20\u9053 <code>textChunkLimit<\/code> \u5185\uff0c\u56e0\u6b64\u4f60\u65e0\u6cd5\u8d85\u8fc7\u6bcf\u6e20\u9053\u7684\u4e0a\u9650\u3002<\/p>\n<h2>\u5408\u5e76\uff08\u5408\u5e76\u6d41\u5f0f\u5757\uff09<\/h2>\n<p>\u542f\u7528\u5206\u5757\u6d41\u5f0f\u4f20\u8f93\u65f6\uff0cOpenClaw \u53ef\u4ee5\u5728\u53d1\u9001\u524d<strong>\u5408\u5e76\u8fde\u7eed\u7684\u5757\u5206\u5757<\/strong>\u3002\u8fd9\u51cf\u5c11\u4e86&#8221;\u5355\u884c\u5237\u5c4f&#8221;\uff0c\u540c\u65f6\u4ecd\u63d0\u4f9b\u6e10\u8fdb\u5f0f\u8f93\u51fa\u3002<\/p>\n<ul>\n<li>\u5408\u5e76\u5728<strong>\u7a7a\u95f2\u95f4\u9699<\/strong>\uff08<code>idleMs<\/code>\uff09\u540e\u5237\u65b0\u3002<\/li>\n<li>\u7f13\u51b2\u533a\u53d7 <code>maxChars<\/code> \u9650\u5236\uff0c\u8d85\u8fc7\u65f6\u5c06\u5237\u65b0\u3002<\/li>\n<li><code>minChars<\/code> \u9632\u6b62\u5fae\u5c0f\u7247\u6bb5\u53d1\u9001\uff0c\u76f4\u5230\u7d2f\u79ef\u8db3\u591f\u6587\u672c\uff08\u6700\u7ec8\u5237\u65b0\u59cb\u7ec8\u53d1\u9001\u5269\u4f59\u6587\u672c\uff09\u3002<\/li>\n<li>\u8fde\u63a5\u7b26\u4ece <code>blockStreamingChunk.breakPreference<\/code> \u6d3e\u751f\uff08<code>paragraph<\/code> \u2192 <code>nn<\/code>\uff0c<code>newline<\/code> \u2192 <code>n<\/code>\uff0c<code>sentence<\/code> \u2192 \u7a7a\u683c\uff09\u3002<\/li>\n<li>\u6e20\u9053\u8986\u76d6\u901a\u8fc7 <code>*.blockStreamingCoalesce<\/code> \u53ef\u7528\uff08\u5305\u62ec\u6bcf\u8d26\u6237\u914d\u7f6e\uff09\u3002<\/li>\n<li>\u9664\u975e\u8986\u76d6\uff0cSignal\/Slack\/Discord \u7684\u9ed8\u8ba4\u5408\u5e76 <code>minChars<\/code> \u63d0\u9ad8\u5230 1500\u3002<\/li>\n<\/ul>\n<h2>\u5757\u4e4b\u95f4\u7684\u7c7b\u4eba\u8282\u594f<\/h2>\n<p>\u542f\u7528\u5206\u5757\u6d41\u5f0f\u4f20\u8f93\u65f6\uff0c\u4f60\u53ef\u4ee5\u5728\u5757\u56de\u590d\u4e4b\u95f4\u6dfb\u52a0<strong>\u968f\u673a\u6682\u505c<\/strong>\uff08\u5728\u7b2c\u4e00\u4e2a\u5757\u4e4b\u540e\uff09\u3002\u8fd9\u4f7f\u591a\u6c14\u6ce1\u54cd\u5e94\u611f\u89c9\u66f4\u81ea\u7136\u3002<\/p>\n<ul>\n<li>\u914d\u7f6e\uff1a<code>agents.defaults.humanDelay<\/code>\uff08\u901a\u8fc7 <code>agents.list[].humanDelay<\/code> \u6309\u667a\u80fd\u4f53\u8986\u76d6\uff09\u3002<\/li>\n<li>\u6a21\u5f0f\uff1a<code>off<\/code>\uff08\u9ed8\u8ba4\uff09\u3001<code>natural<\/code>\uff08800\u20132500ms\uff09\u3001<code>custom<\/code>\uff08<code>minMs<\/code>\/<code>maxMs<\/code>\uff09\u3002<\/li>\n<li>\u4ec5\u9002\u7528\u4e8e<strong>\u5757\u56de\u590d<\/strong>\uff0c\u4e0d\u9002\u7528\u4e8e\u6700\u7ec8\u56de\u590d\u6216\u5de5\u5177\u6458\u8981\u3002<\/li>\n<\/ul>\n<h2>&#8220;\u6d41\u5f0f\u4f20\u8f93\u5757\u6216\u5168\u90e8\u5185\u5bb9&#8221;<\/h2>\n<p>\u8fd9\u6620\u5c04\u5230\uff1a<\/p>\n<ul>\n<li><strong>\u6d41\u5f0f\u4f20\u8f93\u5757\uff1a<\/strong> <code>blockStreamingDefault: \"on\"<\/code> + <code>blockStreamingBreak: \"text_end\"<\/code>\uff08\u8fb9\u751f\u6210\u8fb9\u53d1\u51fa\uff09\u3002\u975e Telegram \u6e20\u9053\u8fd8\u9700\u8981 <code>*.blockStreaming: true<\/code>\u3002<\/li>\n<li><strong>\u6700\u540e\u6d41\u5f0f\u4f20\u8f93\u5168\u90e8\u5185\u5bb9\uff1a<\/strong> <code>blockStreamingBreak: \"message_end\"<\/code>\uff08\u5237\u65b0\u4e00\u6b21\uff0c\u5982\u679c\u5f88\u957f\u53ef\u80fd\u6709\u591a\u4e2a\u5757\uff09\u3002<\/li>\n<li><strong>\u65e0\u5206\u5757\u6d41\u5f0f\u4f20\u8f93\uff1a<\/strong> <code>blockStreamingDefault: \"off\"<\/code>\uff08\u53ea\u6709\u6700\u7ec8\u56de\u590d\uff09\u3002<\/li>\n<\/ul>\n<p><strong>\u6e20\u9053\u8bf4\u660e\uff1a<\/strong> \u5bf9\u4e8e\u975e Telegram \u6e20\u9053\uff0c\u5206\u5757\u6d41\u5f0f\u4f20\u8f93<strong>\u9ed8\u8ba4\u5173\u95ed<\/strong>\uff0c\u9664\u975e <code>*.blockStreaming<\/code> \u660e\u786e\u8bbe\u7f6e\u4e3a <code>true<\/code>\u3002Telegram \u53ef\u4ee5\u5728\u6ca1\u6709\u5757\u56de\u590d\u7684\u60c5\u51b5\u4e0b\u6d41\u5f0f\u4f20\u8f93\u8349\u7a3f\uff08<code>channels.telegram.streamMode<\/code>\uff09\u3002<\/p>\n<p>\u914d\u7f6e\u4f4d\u7f6e\u63d0\u9192\uff1a<code>blockStreaming*<\/code> \u9ed8\u8ba4\u503c\u4f4d\u4e8e <code>agents.defaults<\/code> \u4e0b\uff0c\u800c\u4e0d\u662f\u6839\u914d\u7f6e\u3002<\/p>\n<h2>Telegram \u8349\u7a3f\u6d41\u5f0f\u4f20\u8f93\uff08\u7c7b\u4ee4\u724c\uff09<\/h2>\n<p>Telegram \u662f\u552f\u4e00\u652f\u6301\u8349\u7a3f\u6d41\u5f0f\u4f20\u8f93\u7684\u6e20\u9053\uff1a<\/p>\n<ul>\n<li>\u5728<strong>\u5e26\u4e3b\u9898\u7684\u79c1\u804a<\/strong>\u4e2d\u4f7f\u7528 Bot API <code>sendMessageDraft<\/code>\u3002<\/li>\n<li><code>channels.telegram.streamMode: \"partial\" | \"block\" | \"off\"<\/code>\u3002<\/li>\n<li><code>partial<\/code>\uff1a\u7528\u6700\u65b0\u7684\u6d41\u5f0f\u6587\u672c\u66f4\u65b0\u8349\u7a3f\u3002<\/li>\n<li><code>block<\/code>\uff1a\u4ee5\u5206\u5757\u65b9\u5f0f\u66f4\u65b0\u8349\u7a3f\uff08\u76f8\u540c\u7684\u5206\u5757\u5668\u89c4\u5219\uff09\u3002<\/li>\n<li><code>off<\/code>\uff1a\u65e0\u8349\u7a3f\u6d41\u5f0f\u4f20\u8f93\u3002<\/li>\n<li>\u8349\u7a3f\u5206\u5757\u914d\u7f6e\uff08\u4ec5\u7528\u4e8e <code>streamMode: \"block\"<\/code>\uff09\uff1a<code>channels.telegram.draftChunk<\/code>\uff08\u9ed8\u8ba4\u503c\uff1a<code>minChars: 200<\/code>\uff0c<code>maxChars: 800<\/code>\uff09\u3002<\/li>\n<li>\u8349\u7a3f\u6d41\u5f0f\u4f20\u8f93\u4e0e\u5206\u5757\u6d41\u5f0f\u4f20\u8f93\u5206\u5f00\uff1b\u5757\u56de\u590d\u9ed8\u8ba4\u5173\u95ed\uff0c\u4ec5\u5728\u975e Telegram \u6e20\u9053\u4e0a\u901a\u8fc7 <code>*.blockStreaming: true<\/code> \u542f\u7528\u3002<\/li>\n<li>\u6700\u7ec8\u56de\u590d\u4ecd\u7136\u662f\u666e\u901a\u6d88\u606f\u3002<\/li>\n<li><code>\/reasoning stream<\/code> \u5c06\u63a8\u7406\u5199\u5165\u8349\u7a3f\u6c14\u6ce1\uff08\u4ec5\u9650 Telegram\uff09\u3002<\/li>\n<\/ul>\n<p>\u5f53\u8349\u7a3f\u6d41\u5f0f\u4f20\u8f93\u6d3b\u8dc3\u65f6\uff0cOpenClaw \u4f1a\u4e3a\u8be5\u56de\u590d\u7981\u7528\u5206\u5757\u6d41\u5f0f\u4f20\u8f93\u4ee5\u907f\u514d\u53cc\u91cd\u6d41\u5f0f\u4f20\u8f93\u3002<\/p>\n<pre><code>Telegram\uff08\u79c1\u804a + \u4e3b\u9898\uff09\n  \u2514\u2500 sendMessageDraft\uff08\u8349\u7a3f\u6c14\u6ce1\uff09\n       \u251c\u2500 streamMode=partial \u2192 \u66f4\u65b0\u6700\u65b0\u6587\u672c\n       \u2514\u2500 streamMode=block   \u2192 \u5206\u5757\u5668\u66f4\u65b0\u8349\u7a3f\n  \u2514\u2500 \u6700\u7ec8\u56de\u590d \u2192 \u666e\u901a\u6d88\u606f\n<\/code><\/pre>\n<p>\u56fe\u4f8b\uff1a<\/p>\n<ul>\n<li><code>sendMessageDraft<\/code>\uff1aTelegram \u8349\u7a3f\u6c14\u6ce1\uff08\u4e0d\u662f\u771f\u6b63\u7684\u6d88\u606f\uff09\u3002<\/li>\n<li><code>final reply<\/code>\uff1a\u666e\u901a Telegram \u6d88\u606f\u53d1\u9001\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6d41\u5f0f\u4f20\u8f93\u548c\u5206\u5757 \u6d41\u5f0f\u4f20\u8f93 + \u5206\u5757 OpenClaw \u6709\u4e24\u4e2a\u72ec\u7acb\u7684&#8221;\u6d41\u5f0f\u4f20\u8f93&#8221;\u5c42\uff1a \u5206 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-106","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"predecessor-version":[{"id":401,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/106\/revisions\/401"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}