惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
博客园 - 司徒正美
美团技术团队
Martin Fowler
Martin Fowler
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
爱范儿
爱范儿
U
Unit 42
Y
Y Combinator Blog
月光博客
月光博客
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
GbyAI
GbyAI
H
Help Net Security
量子位
Last Week in AI
Last Week in AI
博客园_首页
腾讯CDC
小众软件
小众软件

Chat SDK Documentation

History | Chat SDK History | Chat SDK List a vendor-official adapter | Chat SDK Approvals | Chat SDK Vercel Connect | Chat SDK Teams Low-Level APIs | Chat SDK CLI | Chat SDK Platform Adapters | Chat SDK State Adapters | Chat SDK Cards | Chat SDK Getting Started | Chat SDK Introduction | Chat SDK Modals | Chat SDK Slack Low-Level APIs | Chat SDK Streaming | Chat SDK Testing | Chat SDK Overview | Chat SDK toAiMessages | Chat SDK Cards | Chat SDK Overview | Chat SDK Markdown | Chat SDK Modals | Chat SDK AI SDK Tools | Chat SDK Types | Chat SDK Message Subject | Chat SDK Conversation History | Chat SDK Transcripts | Chat SDK Slack bot with Next.js and Redis Actions | Chat SDK Direct Messages | Chat SDK
PostableMessage | Chat SDK
Vercel · 2026-04-06 · via Chat SDK Documentation

The union type accepted by thread.post() for sending messages.

PostableMessage is the union of all message formats accepted by thread.post() and sent.edit().

type PostableMessage =
  | AdapterPostableMessage
  | AsyncIterable<string | StreamChunk | StreamEvent>
  | PostableObject;

PostableObject covers Plan (mutable task lists) and StreamingPlan (streams with platform-specific options) — both documented below.

Raw text passed through as-is to the platform.

await thread.post("Hello world");

PostableRaw

Explicit raw text — behaves the same as a plain string.

await thread.post({ raw: "Hello world" });

PostableMarkdown

Markdown converted to each platform's native format.

await thread.post({ markdown: "**Bold** and _italic_" });

PostableAst

mdast AST converted to each platform's native format. See Markdown for builder functions.

import { root, paragraph, text, strong } from "chat";

await thread.post({
  ast: root([paragraph([strong([text("Hello")])])]),
});

PostableCard

Rich card with interactive elements. See Cards for components.

import { Card, Text } from "chat";

await thread.post(Card({ title: "Hello", children: [Text("World")] }));

You can also pass a card with explicit fallback text:

await thread.post({
  card: Card({ title: "Hello", children: [Text("World")] }),
  fallbackText: "Hello — World",
});

A Plan is a step-by-step task list that mutates after posting. Each addTask / updateTask / complete call re-renders the same message in place. See Plan API for full usage.

import { Plan } from "chat";

const plan = new Plan({ initialMessage: "Researching options..." });
await thread.post(plan);
await plan.addTask({ title: "Look up records" });
await plan.complete({ completeMessage: "Done!" });

Adapters that don't support PostableObject editing render the plan as fallback text and ignore subsequent mutations.

Wraps an async iterable with platform-specific streaming options. Use this when you need to pass options like task grouping or stop blocks through thread.post(). See Streaming with options.

import { StreamingPlan } from "chat";

const planned = new StreamingPlan(stream, {
  groupTasks: "plan",
  endWith: [feedbackBlock],
  updateIntervalMs: 750,
});

await thread.post(planned);

An async iterable of strings, StreamChunk objects, or stream events. The SDK streams the message in real time using platform-native APIs where available.

You can yield structured StreamChunk objects for rich content like task progress cards on platforms that support it (Slack). See Streaming for details.

Both AI SDK stream types are supported:

// fullStream (recommended) — preserves step boundaries in multi-step agents
const result = await agent.stream({ prompt: message.text });
await thread.post(result.fullStream);

// textStream — plain string chunks
await thread.post(result.textStream);

When using fullStream, the SDK auto-detects text-delta and finish-step events, extracting text and inserting paragraph breaks between agent steps.

Used in the files field of any structured message format.