Align human messages to the end

This commit is contained in:
Tat Dat Duong
2025-03-04 14:19:00 +01:00
parent ee42f92949
commit 58fee17088
2 changed files with 3 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ export function HumanMessage({
onSubmit={handleSubmitEdit}
/>
) : (
<p>{contentString}</p>
<p className="text-right">{contentString}</p>
)}
<div className="flex gap-2 items-center ml-auto opacity-0 group-hover:opacity-100 transition-opacity">
<BranchSwitcher

View File

@@ -1,6 +1,6 @@
import { MessageContent } from "@langchain/core/messages";
import type { Message } from "@langchain/langgraph-sdk";
export function getContentString(content: MessageContent): string {
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")