create-agent-chat-app
Version:
Create a LangGraph chat app with one command
10 lines (8 loc) • 333 B
text/typescript
import type { Message } from "@langchain/langgraph-sdk";
export function getContentString(content: Message["content"]): string {
if (typeof content === "string") return content;
const texts = content
.filter((c): c is { type: "text"; text: string } => c.type === "text")
.map((c) => c.text);
return texts.join(" ");
}