Files
agent-chat-ui/src/components/thread/utils.ts
2025-03-04 17:40:04 +01:00

10 lines
333 B
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(" ");
}